-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
173 lines (143 loc) · 4.28 KB
/
start.bat
File metadata and controls
173 lines (143 loc) · 4.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
@echo off
REM Start script for Lua Game Example (Windows)
REM Launches both the LOVE2D game (frontend) and integration examples (backend)
setlocal enabledelayedexpansion
echo ===================================================================
echo Lua Game Example - Start Script
echo ===================================================================
echo.
REM Check prerequisites
echo Checking prerequisites...
echo.
set MISSING_DEPS=0
where love >nul 2>nul
if %errorlevel% neq 0 (
echo [ERROR] LOVE2D is not installed
echo Run install.bat to install dependencies
set MISSING_DEPS=1
)
where node >nul 2>nul
if %errorlevel% neq 0 (
echo [ERROR] Node.js is not installed
echo Run install.bat to install dependencies
set MISSING_DEPS=1
)
if not exist "integration\node_modules" (
echo [ERROR] Node.js dependencies not installed
echo Run install.bat or: cd integration ^&^& npm install
set MISSING_DEPS=1
)
if !MISSING_DEPS! equ 1 (
echo.
echo Please install missing dependencies first.
pause
exit /b 1
)
echo [OK] All prerequisites met
echo.
REM Start menu
echo ===================================================================
echo Select what to start:
echo ===================================================================
echo.
echo 1) LOVE2D Game (Frontend)
echo 2) JavaScript Integration Examples (Backend)
echo 3) TypeScript Integration Examples (Backend)
echo 4) LOVE2D Game + JavaScript Backend
echo 5) LOVE2D Game + TypeScript Backend
echo 6) All (Game + Both Backends)
echo.
set /p choice="Enter your choice (1-6): "
echo.
if "%choice%"=="1" goto start_game
if "%choice%"=="2" goto start_js
if "%choice%"=="3" goto start_ts
if "%choice%"=="4" goto start_game_js
if "%choice%"=="5" goto start_game_ts
if "%choice%"=="6" goto start_all
echo Invalid choice. Exiting.
pause
exit /b 1
:start_game
echo -------------------------------------------------------------------
echo Starting LOVE2D Game...
echo -------------------------------------------------------------------
echo.
love .
goto end
:start_js
echo -------------------------------------------------------------------
echo Starting JavaScript Integration Examples...
echo -------------------------------------------------------------------
echo.
cd integration
node lua-runner.js
cd ..
goto end
:start_ts
echo -------------------------------------------------------------------
echo Starting TypeScript Integration Examples...
echo -------------------------------------------------------------------
echo.
cd integration
call npx ts-node lua-bridge.ts
cd ..
goto end
:start_game_js
echo -------------------------------------------------------------------
echo Starting LOVE2D Game + JavaScript Backend...
echo -------------------------------------------------------------------
echo.
echo [Backend] Starting JavaScript integration...
cd integration
start /B cmd /c "node lua-runner.js"
cd ..
timeout /t 2 /nobreak >nul
echo [Frontend] Starting LOVE2D game...
echo.
love .
goto end
:start_game_ts
echo -------------------------------------------------------------------
echo Starting LOVE2D Game + TypeScript Backend...
echo -------------------------------------------------------------------
echo.
echo [Backend] Starting TypeScript integration...
cd integration
start /B cmd /c "npx ts-node lua-bridge.ts"
cd ..
timeout /t 2 /nobreak >nul
echo [Frontend] Starting LOVE2D game...
echo.
love .
goto end
:start_all
echo -------------------------------------------------------------------
echo Starting All Services...
echo -------------------------------------------------------------------
echo.
if not exist "logs" mkdir logs
echo [Backend] Starting JavaScript integration...
cd integration
start /B cmd /c "node lua-runner.js > ..\logs\js-backend.log 2>&1"
cd ..
timeout /t 1 /nobreak >nul
echo [Backend] Starting TypeScript integration...
cd integration
start /B cmd /c "npx ts-node lua-bridge.ts > ..\logs\ts-backend.log 2>&1"
cd ..
timeout /t 1 /nobreak >nul
echo [Frontend] Starting LOVE2D game...
echo.
echo Backend logs:
echo - JavaScript: logs\js-backend.log
echo - TypeScript: logs\ts-backend.log
echo.
love .
goto end
:end
echo.
echo ===================================================================
echo Services stopped.
echo ===================================================================
pause