CmdRunner - 3d game (CubeRunner clone)
Moderator: DosItHelp
Re: CmdRunner - 3d game (CubeRunner clone)
si se puede romper un bucle For /l
@echo off
@title rompiendo bucle
:main
for /L in (0,1,990) do (
if "%%A"=="50" (goto :salirLoop)
cls
echo. EL BUCLE TERMINADA EN : 50
echo. %%A
)
goto :main
:salirLoop
echo. salio del bucle
pause
cls
exit
goto :salirLoop
@echo off
@title rompiendo bucle
:main
for /L in (0,1,990) do (
if "%%A"=="50" (goto :salirLoop)
cls
echo. EL BUCLE TERMINADA EN : 50
echo. %%A
)
goto :main
:salirLoop
echo. salio del bucle
pause
cls
exit
goto :salirLoop
Re: CmdRunner - 3d game (CubeRunner clone)
Where is the variable name in your FOR /L loop?for /L in (0,1,990) do (
Or do you have another problem? (I don't speak Spanish, sorry).
And how is your issue related to the CmdRunner topic?
Steffen
Re: CmdRunner - 3d game (CubeRunner clone)
Not sure, but I think it relates to the earlier discussion in this thread about achieving breakable endless loops with for (i.e. my ”genious” for /R approach ). DQ2000’s ”solution” is even more confusing, plus it fails badly...
Going to quote my earlier new post, lest it might get lost.
Going to quote my earlier new post, lest it might get lost.
misol101 wrote: ↑05 Dec 2019 07:54Archive update!
According to Mediafire's download stats, Cmdrunner keeps being downloaded at a steady pace. It actually has more downloads than Cmdgfx now (but not as many as Blockout, another unsolved mystery).
It's a bit funny, because all games I've made (Cmdrunner, Blockout, Mariorun, Pong3d) are included in the Cmdgfx archive already (I suppose that's not common knowledge).
Anyway, I realized now that Cmdrunner archive was not updated in a long time and actually has a faulty "death animation" (it runs too fast on fast machines). This bug in the script was fixed in Cmdgfx archive some time ago but not in the Cmdrunner archive. But, now it is.
Another technical change is that the game now utilizes Cmdgfx's Z-buffer. This simplifies the script because there is no longer a need to manually keep track of in which order cubes should be drawn.
Re: CmdRunner - 3d game (CubeRunner clone)
The short answer is No. The loop continues up to the FOR upper limit, although no command is executed after the GOTO.
For a further description of this topic, see The ultimate While loop.
===============================================================
La respuesta es No. El bucle continúa hasta el límite superior del FOR, aunque no se ejecute ningún comando después del GOTO.
Una descripción detallada de este tema aparece en The ultimate While loop.
PS - Este foro está en Inglés. Necesitas usar un traductor para publicar texto en Inglés.
===============================================================
Antonio
Re: CmdRunner - 3d game (CubeRunner clone)
Archive update!
Well, it's dangerous to look at old stuff... it's too easy to start tinkering with it again
I felt the look of the game needed some improvements, so we got:
1. Variable height cubes
2. Shadows (well, Cmdgfx has no built-in support for shadows, so they are faked)
3. If you make it long enough (every 2000 points), the game switches to night mode for a while (just like in original Cuberunner on iOS)
The gameplay and difficulty is exactly the same as before. Oh, and for those that prefer the old look (with none of the above), I put also cmdrunner-classic.bat in the archive
Well, it's dangerous to look at old stuff... it's too easy to start tinkering with it again
I felt the look of the game needed some improvements, so we got:
1. Variable height cubes
2. Shadows (well, Cmdgfx has no built-in support for shadows, so they are faked)
3. If you make it long enough (every 2000 points), the game switches to night mode for a while (just like in original Cuberunner on iOS)
The gameplay and difficulty is exactly the same as before. Oh, and for those that prefer the old look (with none of the above), I put also cmdrunner-classic.bat in the archive
Re: CmdRunner - 3d game (CubeRunner clone)
Archive update
One more change before I leave this alone - it’s now possible to resize the game window, as well as play maximized or fullscreen (Alt-Enter on Win10, Ctrl-Enter on Win7).
Fullscreen was tested up to 1920x1080 resolution. Cmdrunner-classic.bat does not support resizing.
One more change before I leave this alone - it’s now possible to resize the game window, as well as play maximized or fullscreen (Alt-Enter on Win10, Ctrl-Enter on Win7).
Fullscreen was tested up to 1920x1080 resolution. Cmdrunner-classic.bat does not support resizing.
Re: CmdRunner - 3d game (CubeRunner clone)
Archive update!
Oh no, I lied
Of course I also had to turn this into a pixel version (cmdrunner-pixel.bat). It can also be resized or played in fullscreen (though you may need a decent CPU to play in fullscreen)
Oh no, I lied
Of course I also had to turn this into a pixel version (cmdrunner-pixel.bat). It can also be resized or played in fullscreen (though you may need a decent CPU to play in fullscreen)
Re: CmdRunner - 3d game (CubeRunner clone)
Wow that's cool!.
misol 101 do you want to do it with my program PixelDrawTXT-v3 ??? ..
misol 101 do you want to do it with my program PixelDrawTXT-v3 ??? ..
Re: CmdRunner - 3d game (CubeRunner clone)
to exit the for
Code: Select all
@echo off
@title Foor Loop
:main
for /l %%A in (0,1,100) do (
echo. salidas = %%A
break
if "%%A"=="50" (goto :salida)
)
goto :main
:salida
pause
Re: CmdRunner - 3d game (CubeRunner clone)
I assume you read Antonio's answer? You can't break a FOR /L loop in the running process. That might be a cmd.exe bug. But don't hope that it will be fixed. Microsoft explained several times that they won't update cmd.exe anymore.
Steffen
Steffen
Re: CmdRunner - 3d game (CubeRunner clone)
I already tried it myself, Try it yourself if you can!.
Re: CmdRunner - 3d game (CubeRunner clone)
Begin your script with @echo on and you will discern that your loop didn't break even if the output of the body doesn't show up anymore.
Alternatively, take a big number such like for /l %%A in (0,1,1000000) do ( and you will see that it takes ages until you get to the PAUSE prompt.
We already had lengthy discussions about that here at DosTips.
Steffen
Alternatively, take a big number such like for /l %%A in (0,1,1000000) do ( and you will see that it takes ages until you get to the PAUSE prompt.
We already had lengthy discussions about that here at DosTips.
Steffen
Re: CmdRunner - 3d game (CubeRunner clone)
Then the best way would be to load a .DLL to "cmd.exe" in server mode as well.
Re: CmdRunner - 3d game (CubeRunner clone)
Archive update!
Decided to go "full circle" with this, from 16 color characters, to pixel mode, to 24 bit color pixels (cmdrunner-pixel-RGB.bat):
During this I also discovered some limitations of cmdgfx_RGB (like: goraud shade is quite slow so had to use affine textures instead, which together with not being able to set textures outside of an obj file and not being able to shade 3d object colors effectively on-the-fly for 24bit, meant that I had to create 19 new BMP images and 15 obj files just for this version!)
Also: don't expect to run this in full-screen (at full frame-rate) unless your machine is very strong...
Decided to go "full circle" with this, from 16 color characters, to pixel mode, to 24 bit color pixels (cmdrunner-pixel-RGB.bat):
During this I also discovered some limitations of cmdgfx_RGB (like: goraud shade is quite slow so had to use affine textures instead, which together with not being able to set textures outside of an obj file and not being able to shade 3d object colors effectively on-the-fly for 24bit, meant that I had to create 19 new BMP images and 15 obj files just for this version!)
Also: don't expect to run this in full-screen (at full frame-rate) unless your machine is very strong...
Re: CmdRunner - 3d game (CubeRunner clone)
Mini-update: fullscreen (Ctrl-Enter) should now hopefully cover entire screen even when using legacy console or earlier than Windows 10.