SNAKE.BAT 4.1 - An arcade style game using pure batch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: SNAKE.BAT - An arcade style game using pure batch

#46 Post by dbenham » 01 Dec 2013 08:25

I've released version 2.3 at the top of the first post in this thread. I added elapsed game time to the display.

Dave Benham

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: SNAKE.BAT - An arcade style game using pure batch

#47 Post by Ed Dyreen » 01 Dec 2013 23:55

tested on a windows XP 32bit non-virtualized, with SATA hdd.

-Speed Sluggard ( on a 10 year old intel 3Ghz ) it run way too fast otherwise.
-Buttons are confusing, the indicated keys assume QWERTY layout.
-In the original game, the walls do not exist, ( if snake leaves right it reenters left, that dead was unexpected :)
-In the original game, there is no up nor down, just left or right.

Do I get candy now :wink:

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: SNAKE.BAT - An arcade style game using pure batch

#48 Post by foxidrive » 02 Dec 2013 08:21

Ed Dyreen wrote:-Buttons are confusing, the indicated keys assume QWERTY layout.


Arrow keys would be nice.

-In the original game, the walls do not exist, ( if snake leaves right it reenters left, that dead was unexpected :)


I've played it on an Apple ][+ and a Vic 20 and there were mazes. The early ones I played all had walls too.

-In the original game, there is no up nor down, just left or right.


True that.

It works well though, and the timer is good also.

brinda
Posts: 78
Joined: 25 Apr 2012 23:51

Re: SNAKE.BAT - An arcade style game using pure batch

#49 Post by brinda » 04 Dec 2013 21:12

dave,

thanks

ashleyco
Posts: 3
Joined: 03 Sep 2013 23:46
Contact:

Re: SNAKE.BAT - An arcade style game using pure batch

#50 Post by ashleyco » 05 Dec 2013 03:27

Does the program work now that you have gotten past that issue?

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: SNAKE.BAT - An arcade style game using pure batch

#51 Post by dbenham » 05 Dec 2013 14:18

ashleyco wrote:Does the program work now that you have gotten past that issue?


:? What issue :?:

The program has been stable and working fine since July 2013. I've had 2 minor updates since then, but nothing major.


Dave Benham

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: SNAKE.BAT - An arcade style game using pure batch

#52 Post by dbenham » 07 Dec 2013 22:32

I've released version 3.0 8)
As always, the new code is at the top of the first post in this thread.

This new version is a significant release with lots of new features.

1) The keyboard game controls are now user configurable. You can choose between a 2 key configuration (left/right), or 4 key configuration (left/right/up/down). You can also map the movement keys as you see fit. This change should make Ed Dyreen and Aacini happy :D

2) The graphic display is also user configurable. You can choose what characters are used to represent the elements of the playing field. Note that extended ASCII codes ban be used by using the <Alt> key with the numeric keypad.

3) Keyboard control and graphic display user preferences are automatically stored in the %USERPROFILE%\Snake folder.

4) You can watch a "movie" instant replay of the previous game. You get to choose the display speed of the replay.

5) The game now tracks and displays high scores for each of the Difficulty (speed) levels. You can watch a "movie" instant replay of any of the High Scores. Again, you get to choose the display speed of the replay.

6) I eliminated the 0 - Unplayable speed option.


Everything seems to be working well, but its quite a bit of new code. Bug reports are most welcome.

I hope everyone enjoys the new version.


Dave Benham

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: SNAKE.BAT - An arcade style game using pure batch

#53 Post by foxidrive » 07 Dec 2013 22:43

That's brilliant Dave - it's so much fun.

I notice that the code put on weight :D

We can share 'snake movies' now - but the prefs file and the movie file are needed, right?
It might be good to include the prefs inside the movie file so we can playback a movie by sharing one file. Will the previous movie be overwritten if the same settings are used?
If so then adding a date stamp to the filename would be good too.

foxi

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: SNAKE.BAT - An arcade style game using pure batch

#54 Post by dbenham » 08 Dec 2013 00:09

foxidrive wrote:That's brilliant Dave - it's so much fun.

I notice that the code put on weight :D

We can share 'snake movies' now - but the prefs file and the movie file are needed, right?
It might be good to include the prefs inside the movie file so we can playback a movie by sharing one file. Will the previous movie be overwritten if the same settings are used?
If so then adding a date stamp to the filename would be good too.

foxi

:shock: OMG - you're right. :oops: The graphic configuration doesn't matter, but the key assignments are critical. I don't know how I managed to recognize that I needed to put the 2 key vs. 4 key option in the "movie", yet forgot to do the same for the key mapping. I'll fix that and post version 3.1

Thanks

Dave

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: SNAKE.BAT - An arcade style game using pure batch

#55 Post by dbenham » 08 Dec 2013 01:04

OK, the bug has been fixed. The key mappings are now included in the game logs.

Thanks again foxidrive.

One thing I forgot to mention - The code includes a getString routine that allows the user to enter an entire string. It supports the backspace and enter keys. It works, but I ended up not using it. I was thinking of letting the user enter a name to go with the high score, and to have user named game log files. The string entry worked well, but I thought the overall user interface became to complicated, so I abandoned it.


Dave

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: SNAKE.BAT - An arcade style game using pure batch

#56 Post by foxidrive » 08 Dec 2013 03:20

Nice one. Should the previous movies be datestamped so they aren't overwritten?

einstein1969
Expert
Posts: 941
Joined: 15 Jun 2012 13:16
Location: Italy, Rome

Re: SNAKE.BAT - An arcade style game using pure batch

#57 Post by einstein1969 » 08 Dec 2013 07:51

Hi Dave,

There is a problem if I replay more time the previus game. The first time the food is displayed, the next no food is displayed.

Einstein1969

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: SNAKE.BAT - An arcade style game using pure batch

#58 Post by dbenham » 08 Dec 2013 09:56

einstein1969 wrote:Hi Dave,
There is a problem if I replay more time the previus game. The first time the food is displayed, the next no food is displayed.

There must be more to the story. I can't reproduce that behavior on my Win 7 64 machine.

What version are you using? Current version is 3.1. Version 3.0 hi scores will not work with version 3.1
What OS are you on?
What does your %USERPROFILE%\Snake\SnakeUserPref.txt look like?
Exactly what is the pattern - First replay works, and all subsequent replays fail? What happens if you then play a New game, and then replay repeatedly?
What happens if you repeatedly replay a high score game?
Anything else that might help me reproduce the problem?


Dave Benham

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: SNAKE.BAT - An arcade style game using pure batch

#59 Post by dbenham » 08 Dec 2013 10:05

foxidrive wrote:Nice one. Should the previous movies be datestamped so they aren't overwritten?

I'm working on version 3.2 that will allow you to save the previous game, or a High Score game, to a name of your choosing in the current directory.
I will also add a Load option that lets you watch a user saved game. A Loaded game will never update the high scores. That way we can safely share movies.

So I will be using the getString function after all :D


Dave Benham

einstein1969
Expert
Posts: 941
Joined: 15 Jun 2012 13:16
Location: Italy, Rome

Re: SNAKE.BAT - An arcade style game using pure batch

#60 Post by einstein1969 » 08 Dec 2013 10:12

dbenham wrote:
einstein1969 wrote:Hi Dave,
There is a problem if I replay more time the previus game. The first time the food is displayed, the next no food is displayed.

There must be more to the story. I can't reproduce that behavior on my Win 7 64 machine.

What version are you using? Current version is 3.1. Version 3.0 hi scores will not work with version 3.1
What OS are you on?
What does your %USERPROFILE%\Snake\SnakeUserPref.txt look like?
Exactly what is the pattern - First replay works, and all subsequent replays fail? What happens if you then play a New game, and then replay repeatedly?
What happens if you repeatedly replay a high score game?
Anything else that might help me reproduce the problem?


Dave Benham


I have runs the 2.X and the 3.1. I don't probed the 3.0

I use windows 7 32bit

%USERPROFILE%\Snake\SnakeUserPref.txt:

Code: Select all

moveKeys=4
up=W
down=S
left=A
right=D
space=
bound=#
food=+
head=@
body=O
death=X


I have played with 3.1 in 0.20 speed than i have replay at 0.20 and then replay at 0.10 or less (don't remeber)

I have than tested another new game and the food "+" at replay don't show at any speed.

einstein1969
Last edited by einstein1969 on 08 Dec 2013 10:19, edited 1 time in total.

Post Reply