The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
(34S) Crude Snake game
06-01-2014, 12:55 PM (This post was last modified: 06-15-2017 01:21 PM by Gene.)
Post: #1
(34S) Crude Snake game
Since the 34S has some simple commands for polling the keyboard and drawing directly to the (tiny) dot-matrix screen, I figured I may as well see how suitable it is for action games. The results aren't too bad.

Code:
001 LBL'SNK'
002 LocR 16 //Could be reduced. I started the graphics block at 10, and was too lazy to move it down.
003 CLα
004 6
005 ENTER
006 # 043 //Entered via # in the CONST menu
007 gDIM .10
008 3
009 STO .00
010 STO .01
011 1
012 STO .02
013 0
014 STO .03
015 STO .04
016 LBL 20
017 RCL .01
018 RCL .00
019 gPIX? .10
020 GTO 99
021 gSET .10
022 RCL .04
023 gPLOT .10
024 PSE 01
025 KEY? X
026 GTO 21
027 KTP? X
028 LBL?->X
029 GTO->X
030 GTO 21
031 LBL 02
032 1
033 STO .03
034 0
035 STO .02
036 GTO 21
037 LBL 04
038 1
039 +/-
040 STO .02
041 0
042 STO .03
043 GTO 21
044 LBL 06
045 1
046 STO .02
047 0
048 STO .03
049 GTO 21
050 LBL 08
051 1
052 +/-
053 STO .03
054 0
055 STO .02
056 GTO 21
057 LBL 21
058 RCL .00
059 RCL+ .02
060 # 043
061 MOD
062 STO .00
063 RCL .01
064 RCL+ .03
065 6
066 MOD
067 STO .01
068 INC .04
069 GTO 20
070 LBL 99
071 RCL .04
072 CLα
072 α'GAM'
073 α'E O'
074 α'VER'
075 VWα+ X
076 RTN
078 END

Just XEQ'SNK', and the game begins immediately. Use 2, 4, 6, and 8 to control the snake's direction. The snake can wrap around the edges of the playfield. Your score is displayed during and after the game.

There's plenty of room for improvement here. I'm not real pleased with the keyboard handling, but I wrote it at 2:00 AM.

Seems like it's a bit more sluggish than I would expect based on the hardware, but that's probably because gPLOT has to blit the entire screen from several registers, rather than being able to directly poke at bits in the display RAM. Paul, Walter, more graphics commands for future firmware versions perhaps? Smile
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(34S) Crude Snake game - Dave Britten - 06-01-2014 12:55 PM
RE: (WP-34S) Crude Snake game - inaqui76 - 11-05-2015, 04:35 PM
RE: (WP-34S) Crude Snake game - fhub - 11-05-2015, 04:50 PM
RE: (WP-34S) Crude Snake game - inaqui76 - 11-05-2015, 06:16 PM
RE: (WP-34S) Crude Snake game - fhub - 11-05-2015, 06:44 PM
RE: (WP-34S) Crude Snake game - inaqui76 - 11-05-2015, 06:51 PM
RE: (WP-34S) Crude Snake game - Paul Dale - 11-12-2015, 07:39 AM



User(s) browsing this thread: 2 Guest(s)