Author Topic: Re: a simple snake game  (Read 8018 times)

0 Members and 1 Guest are viewing this topic.

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: a simple snake game
« Reply #15 on: February 27, 2019, 04:18:14 pm »
BPlus,

_KEYCLEAR worked like a charm.. 33 and counting... Woo Hoo!

TempodiBasic,

I certainly did remember Nibbles. One of the first places I went to look for ideas... Cool game. Rattler? I'll have to check that one out...

Hey. I just thought of something... (stop laughing bplus...) I hope that Ron77  doesn't think his game has been hijacked... I've seen this kind of thing happen before. Ask for simple help, and before you know it, the game is running in 3D; surround sound; multi leveled; multi player; looking almost like nothing of the original. I know this is an exaggeration, but a simple plea for help, can escalate into something that could scare people off... Just a thought... Paranoid (No. Not Pink Floyd) or too much caffeine? lol
Logic is the beginning of wisdom.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: a simple snake game
« Reply #16 on: February 27, 2019, 06:26:09 pm »
Hi Steve,

I tried your game and then lowered the limit and then lowered it again... yep there is delayed reaction to a key press, it always moves one more step (at least) before responding to keypress. Oh hey I will try _KEYCLEAR here too. BTW, your mod has a whole different spirit to Snake Game than I am use to; it reminds me of Terry Richie's game with falling red and white squares.
Append: nope, there is definite delay, you have to press a whole square in advance of changing direction.

“It’s not a bug; it’s a feature.”  ;)

Most folks won’t believe that, but in this case, it’s true.  I was intending for the snake to be a square behind, so it’d increase the navigation difficulty.  When playing, I found it much more entertaining to cuss my screen every time I tried to line up one of the feed dots and instead ran circles around it, always off by a single position.

You can correct the issue by letting it move/display THEN eat, while mine instead moves/displays/eats all in the same step.  It’s not an issue _KEYCLEAR can solve, as it’s built into the processing commands instead, and suits the “vision of this version”.  Think of it like being the driver of a train down city streets — when in the middle of a city block, do you turn, or wait until the next intersection?

I just liked the gameplay (and inevitable frustration) inherent in the delayed processing.  It’s the type of game you pull out and tell your friends, “Try this!  You can’t beat me at it!”, once you notice and train yourself to respond a second earlier than your eyes tell you to...  ;D
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: a simple snake game
« Reply #17 on: February 27, 2019, 11:28:38 pm »
Woo Hoo! I got to 118 but had to stop...  My coffee machine began suffering from neglect....

Cool game. Nicely done!

J
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: a simple snake game
« Reply #18 on: February 28, 2019, 09:14:37 am »
I do better with the basic game too, it is because this version does not kill the snake when you press a key to reverse the direction. It is instinctive to reverse, but the change in direction should not be allowed, perhaps just ignore the keypress?

Marked as best answer by on August 13, 2021, 10:33:17 pm

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: a simple snake game
« Reply #19 on: February 28, 2019, 02:16:04 pm »
Oh, I enjoy 'not dying' for a change. As they say, and it's never said who 'they' are, a change is as good as a holiday... Are 'you' going to be responsible for destroying my holiday? Hmm... Are you? lol
Logic is the beginning of wisdom.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: a simple snake game
« Reply #20 on: February 28, 2019, 04:07:50 pm »
Hi Ron77
cool
it remember me the marathon of Nibbles!

Thanks

PS
I have found a bug while I'm playing

the X rarely is placed in a cell occupied by the body of the snake! And you can see it only when the body goes away from that cell.

 
snake by ron77 bug.jpg
Programming isn't difficult, only it's  consuming time and coffee

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: a simple snake game
« Reply #21 on: February 28, 2019, 07:08:06 pm »
I noticed that as well a couple of times but didn't give it any mind. I just continued moving and eventually the food would show up... It's a "me and food" thing...

Curious. In your displayed listing; line 62; How do you get the solid block within the quotes to display? I have to use 'print chr$()'. (I like your colour scheme - what are the settings?)

J
« Last Edit: February 28, 2019, 07:18:43 pm by johnno56 »
Logic is the beginning of wisdom.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: a simple snake game
« Reply #22 on: March 02, 2019, 04:11:14 pm »
Hi jonnho56

about scheme colour

open the file   internal\config.txt
and goes to the last line of text under
'[IDE COLOR SCHEMES]

and add this line
Code: QB64: [Select]
  1. Scheme4$ = "Dark Sun|255147000206206000245010098000177000085255085049186245011022029100098000000147177"

save and load QB64 now you can select this scheme in     Options-> IDE Colors

and you can try also this other that I have used for a time
Code: QB64: [Select]
  1. Scheme5$ = "Dark Violet|170000255220110000245010140020177070060255060049186245011022029100100160000147177"


about to show a ASCII character as string and not with CHR$()  I use the utility of Steve in this manner

while I'm typing if I need a special character I use this sequence
Help--> ASCII chart --> it appears the table of the utility of Steve McNeill, well now I click in it on the character that I want to get and it is typed into the IDE editor. (it sometimes doesn't work but at the second attempt it works properly)

Fine to be useful.
Programming isn't difficult, only it's  consuming time and coffee

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: a simple snake game
« Reply #23 on: March 04, 2019, 06:42:47 am »
Wow. Many thanks for the schemes. Much appreciated.
Logic is the beginning of wisdom.

Offline qb4ever

  • Newbie
  • Posts: 40
  • LOCATE 15,15: COLOR 14: PRINT "Hello World!"
    • View Profile
Re: a simple snake game
« Reply #24 on: March 05, 2019, 05:04:02 am »
Great job ron77 !

FellippeHeitor

  • Guest
Re: a simple snake game
« Reply #25 on: March 05, 2019, 11:20:04 pm »
Even if you don't have a '[IDE COLOR SCHEMES] section in your config.txt file, you can simply add the scheme lines shared above. Here's a little secret: QB64 ignores section headings.

So, simply paste the lines below into your config.txt file, anywhere. What really matters is that your scheme lines start at Scheme1$, so just rename them Scheme1$ and Scheme2$ instead of 4 and 5:

Code: QB64: [Select]
  1. Scheme1$ = "Dark Sun|255147000206206000245010098000177000085255085049186245011022029100098000000147177"
  2. Scheme2$ = "Dark Violet|170000255220110000245010140020177070060255060049186245011022029100100160000147177"

That should give you two new schemes in the Options->IDE Colors dialog.
« Last Edit: March 05, 2019, 11:22:01 pm by FellippeHeitor »

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: a simple snake game
« Reply #26 on: March 08, 2019, 06:45:01 pm »
Hi guys
here other color schemes
https://www.qb64.org/forum/index.php?topic=550.msg5912#msg5912 by Zepelin
https://www.qb64.org/forum/index.php?topic=550.msg100263#msg100263 by Steve

so you can have more changes in IDE Colors' option.
Programming isn't difficult, only it's  consuming time and coffee