CmdRunner - 3d game (CubeRunner clone)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
DQ2000
Posts: 38
Joined: 07 Aug 2019 17:26

Re: CmdRunner - 3d game (CubeRunner clone)

#31 Post by DQ2000 » 05 Dec 2019 10:56

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

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: CmdRunner - 3d game (CubeRunner clone)

#32 Post by aGerman » 05 Dec 2019 11:04

for /L in (0,1,990) do (
Where is the variable name in your FOR /L loop?
Or do you have another problem? (I don't speak Spanish, sorry).
And how is your issue related to the CmdRunner topic?

Steffen

misol101
Posts: 475
Joined: 02 May 2016 18:20

Re: CmdRunner - 3d game (CubeRunner clone)

#33 Post by misol101 » 06 Dec 2019 06:22

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.
misol101 wrote:
05 Dec 2019 07:54
Archive 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.

Aacini
Expert
Posts: 1913
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: CmdRunner - 3d game (CubeRunner clone)

#34 Post by Aacini » 06 Dec 2019 06:37

DQ2000 wrote:
05 Dec 2019 10:56
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
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

misol101
Posts: 475
Joined: 02 May 2016 18:20

Re: CmdRunner - 3d game (CubeRunner clone)

#35 Post by misol101 » 07 Dec 2019 17:42

Archive update!

Well, it's dangerous to look at old stuff... it's too easy to start tinkering with it again :mrgreen:

Image

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

misol101
Posts: 475
Joined: 02 May 2016 18:20

Re: CmdRunner - 3d game (CubeRunner clone)

#36 Post by misol101 » 13 Dec 2019 11:53

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.

misol101
Posts: 475
Joined: 02 May 2016 18:20

Re: CmdRunner - 3d game (CubeRunner clone)

#37 Post by misol101 » 19 Dec 2019 12:00

Archive update!

Oh no, I lied :mrgreen:

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)

Image
ImageImage

DQ2000
Posts: 38
Joined: 07 Aug 2019 17:26

Re: CmdRunner - 3d game (CubeRunner clone)

#38 Post by DQ2000 » 19 Dec 2019 19:35

Wow that's cool!.
misol 101 do you want to do it with my program PixelDrawTXT-v3 ??? ..

DQ2000
Posts: 38
Joined: 07 Aug 2019 17:26

Re: CmdRunner - 3d game (CubeRunner clone)

#39 Post by DQ2000 » 19 Dec 2019 21:15

aGerman wrote:
05 Dec 2019 11:04
for /L in (0,1,990) do (
Where is the variable name in your FOR /L loop?
Or do you have another problem? (I don't speak Spanish, sorry).
And how is your issue related to the CmdRunner topic?

Steffen

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

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: CmdRunner - 3d game (CubeRunner clone)

#40 Post by aGerman » 20 Dec 2019 07:04

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

DQ2000
Posts: 38
Joined: 07 Aug 2019 17:26

Re: CmdRunner - 3d game (CubeRunner clone)

#41 Post by DQ2000 » 21 Dec 2019 03:49

I already tried it myself, Try it yourself if you can!.

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: CmdRunner - 3d game (CubeRunner clone)

#42 Post by aGerman » 21 Dec 2019 06:27

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

DQ2000
Posts: 38
Joined: 07 Aug 2019 17:26

Re: CmdRunner - 3d game (CubeRunner clone)

#43 Post by DQ2000 » 25 Dec 2019 20:45

Then the best way would be to load a .DLL to "cmd.exe" in server mode as well.

misol101
Posts: 475
Joined: 02 May 2016 18:20

Re: CmdRunner - 3d game (CubeRunner clone)

#44 Post by misol101 » 28 Dec 2019 08:59

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):

Image
Image

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... :(

misol101
Posts: 475
Joined: 02 May 2016 18:20

Re: CmdRunner - 3d game (CubeRunner clone)

#45 Post by misol101 » 03 Feb 2020 15:20

Mini-update: fullscreen (Ctrl-Enter) should now hopefully cover entire screen even when using legacy console or earlier than Windows 10.

Post Reply