Jump to content

Photo

Simple Game in Forth: The Snake


7 replies to this topic

#1 TheBF OFFLINE  

TheBF

    Moonsweeper

  • 399 posts
  • Location:The Great White North

Posted Mon Nov 20, 2017 2:31 PM

Will reviewing a site that had Forth running in a browser I found the source code for the snake game.

I thought it be it useful for people learning Forth so I modified it to run on the TI-99 and added some features.

 

This game can be pasted into CAMEL99 Forth.

Download the current program in EA5 format file here: 

 

 https://github.com/b...ter/bin/CAMEL99

 

Run the CAMEL99 program and then paste the source code from the spoiler below into the Classic99 emulator window and type RUN <enter>

 

For Turbo Forth and FB Forth users, it would not be a very difficult job to port it over but there might be a few questions that I am sure Mark, Lee or myself would be happy to respond to.

(Note: CAMEL99 uses TI BASIC color values so they are off by 1 for FB-Forth and Turbo Forth)

 

Spoiler

Edited by TheBF, Mon Nov 20, 2017 2:36 PM.


#2 Vorticon OFFLINE  

Vorticon

    River Patroller

  • 2,813 posts
  • Location:Eagan, MN, USA

Posted Mon Nov 20, 2017 3:38 PM

Cool little game :)



#3 atrax27407 OFFLINE  

atrax27407

    Dragonstomper

  • 797 posts

Posted Mon Nov 20, 2017 4:51 PM

There is already a "snake" demo in TurboForth. It could be turned into a game quite easily.



#4 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

  • 3,432 posts
  • Location:Silver Run, Maryland

Posted Mon Nov 20, 2017 10:37 PM

I will port it to fbForth 2.0 in a day or two—but, first I must fix a bug in fbForth 2.0 that I introduced to some of the sprite primitives, probably as far back as fbForth 2.0:8.  I will detail the bug and its fix on my website and in the fbForth development thread by tomorrow’s end.

 

...lee



#5 Willsy OFFLINE  

Willsy

    River Patroller

  • 3,029 posts
  • Location:Uzbekistan (no, really!)

Posted Tue Nov 21, 2017 2:49 AM

I will port it to fbForth 2.0 in a day or twobut, first I must fix a bug in fbForth 2.0 that I introduced to some of the sprite primitives, probably as far back as fbForth 2.0:8.  I will detail the bug and its fix on my website and in the fbForth development thread by tomorrows end.
 
...lee


Bugs in cartridge software is such a pain in the ass, eh?!

#6 atrax27407 OFFLINE  

atrax27407

    Dragonstomper

  • 797 posts

Posted Tue Nov 21, 2017 6:48 AM

Do I detect another build in the works?



#7 TheBF OFFLINE  

TheBF

    Moonsweeper

  • Topic Starter
  • 399 posts
  • Location:The Great White North

Posted Tue Nov 21, 2017 7:13 AM

I will port it to fbForth 2.0 in a day or two—but, first I must fix a bug in fbForth 2.0 that I introduced to some of the sprite primitives, probably as far back as fbForth 2.0:8.  I will detail the bug and its fix on my website and in the fbForth development thread by tomorrow’s end.

 

...lee

 

 

If debugging is the art of removing bugs, then programming must be the art of putting bugs in. :-)

 

It's a humbling activity, this.

 

B



#8 TheBF OFFLINE  

TheBF

    Moonsweeper

  • Topic Starter
  • 399 posts
  • Location:The Great White North

Posted Sat Dec 9, 2017 1:34 PM

A new version of the SNAKE with sound enhancements

I have been playing with methods to do sound control without using interrupts and sound lists.

 

I think I am getting somewhere.  The spoiler has the new version with sounds.

I added scraping as the snake slides, a squeak when the mouse gets eaten and nice swoosh when a new mouse materializes.

I will explain the sound control words in another topic.

 

(I have not got past 50 segments of snake length playing this myself.)

 

Spoiler





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users