Jump to content
IGNORED

New 32k XB Game:ZOMBi (work in progress)


Sinphaltimus

Recommended Posts

post-47352-0-54359600-1475888395_thumb.pngpost-47352-0-58867900-1480287385_thumb.png]post-47352-0-93672600-1480287386_thumb.pngpost-47352-0-18582900-1483208534_thumb.png


ZOMBi v0.54 beta

 

>>>DOWNLOAD>>>post-47352-0-36913400-1483383694_thumb.png<<<HERE<<< continue reading for more details.


Whether or not you've been following this thread :http://atariage.com/forums/topic/254360-graphics-on-your-ti-are-you-interested/
I hope you'll enjoy this.

I started doing animation and graphics stuff on that other thread.
Then I started using joystick controls etc.. I made a little pixel man that runs and jump.
Then I added a random hole he could fall into or jump over.
Then I got an idea for a game so I'm going to make it. It's called ZOMBi.


GAME IS CURRENTLY in ALPHA version. Beta coming soon! (maybe)

*IMPORTANT* - game is no longer playable in Extended Basic (way too slow to be considered playable). You must load the ZOMB54-A file into Editor Assembly Option 5 or load the .bin file on to a FlashRom99 or in to Classic99(8.bin) to play. (3 easiest methods, there are more)

To play test, download the zip for the Source created in TidBit, 8.bin file & Extended Basic Text for Classic99 use and non-inverted rom created using Fred Kaal's Module Creator 2. Image compression and compiling made possible by Harry Wilhelm's XB256 and Harry Wilhelm's 256 Compressor - both available via Classic99.

 

ZOMB54-A,-B,-C = EA5 files created using editor assembler cartridge via classic99. Use this to load option 5 DSKx.ZOMBI47-A

ZOMB54-X = classic99 save file executable using Harry Wilhelm's XB256

ZOMBITS3-M = classic99 saved merge file of compressed title screens using Harry Wilhelm's Compiler

ZOMBIV054-32K8.bin = FlashRom99 and Classic99 ready bin file 32k - copy to FlashRom99 or Load as cartridge in classic99.

ZOMBtiV54MERGED.txt = Extended BASIC Merged code of ZOMB49-x above, in plain text for review only.
ZOMBtiV54_source.txt = my original plain text source code created for TidBit translation.

post-47352-0-36913400-1483383694_thumb.png


How To Play:

About: This is meant to be a semi casual zombie survival game to escape a skyscraper. Play for score (session high score coming soon)

 

post-47352-0-06556900-1480287384_thumb.png

Combat:
Joystick up = A melee attack and is a swing attack that covers the space directly in front and behind the player. You get one attack per inventory item. Melee destroys loot.
Joystick down = A ranged attack. Fires one bullet in the direction the player is facing. One shot per inventory item. Bullets destroy loot. Bullets miss everything within 5 spaces and will lose accuracy over long distances. Find the sweet spot.

ZOMBiES: Will grab you and attack you at lower levels. Hold jump to escape, try hitting with melee, break away as fast as you can.

DODGE: You can attempt to dodge zeds by jumping past them.

LOOTING: Will slow you down, jump past it to dodge the loot if you need to.

Controls:
X=Quit, R=Reset game, Q and Controller Button = Jump, Joystick Left/Right moves left/right,
Joystick up = melee attack - Joystick down = ranged attack.

*Developer cheats for testing: Press B to advance a level downward - no points given - used to test loot balance level progression.

Notes:
Don't mash the jump button, press and hold. It is not possible to run over holes or run past loot without picking it up.

The crumbling floor on each side of the hole? Be careful of loose gravel, you can slip and fall.

Backstory: It's the zombie apocalypse. Hordes of the living dead are roaming the streets, you hear a helicopter and climb the tallest building level by crumbling level. You get to the roof and just as you make it to the end, the roof door is barred and you hear the helicopter motors fading in to the distance. Then you hear another sound. The sound of the dead creeping in and closer. They must have followed you. Now, it's time to get out. Escape to the ground floor street level. Good Luck.

V0.54 changes:
On Going - Optimize variables - reduce & reuse - save ram. Was able to free up 200-300k program space. More to come.
Eliminated need for Melee and Ranged loot sprites. using call v/hChar instead. Reduces sprites per line in most cases and
gets rid of 2 coinc checks for zeds. This also requires weapons and floors and walls be the same color.
Going to play with the color and try out several different ones. Maybe give a new color every x levels..
.
KNOWN ISSUES:
NOT ALL FUNCTIONALITY HAS BEEN DEVELOPED AS OF THIS VERSION.
Bullets missing zombies a lot more often now. Need to fix.
On levels full of zombies, game is too slow to play. You can experience this on level 90.
Press B to skip to the next board. Need to optimize COINC further.
Highscore screen and you are dead screens need fixing to display score/highscore.
Loot balance zombie distribution.
Need to save zedstepr to fix all animation glitches where zed legs slide.
To Do Next:
On Going - Optimize variables - reduce & reuse - save ram
Adjust girder and weapon loot color.
Put back player damage while crouched.
Use on GoSub to reduce amount of code?
CHECK PERFORMANCE WITH 14 ZEDS, WITH 14 ZEDS FOLLOWING. ****super slow****
Change delay in title screens (check Sr. Falcons coments around v048-050)
Mitigate known issues as they arise
Continue to add more comments to source code
Remove developer cheats.
Running low on memory. Barely able to run in XB256 PC Overdrive via classic99.
Maybe Not - Free Pass: At level 10 and below, you get one freepass to use per level. You use it or lose it at the exit.
A free pass will give you 5 health, 10 melee and 10 ranged in inventory.You can use the free pass
once per level from this point on. It will cost you 333 points each time used. Nothing is free.
Use jump and hold joyst down when landing to use free pass power up.
Final level showdown.
Add SYMM to title. Add credits screen to include products used and community support.
MUSIC/Soundtrack
Then there's all the secondary stuff and polish. Like having Zombie death and loot destroyed animations with sound
effects. Possibly redoing much of the existing artwork. Maybe change up ZEDai so they will randomly change direction
instead of waiting to hit a hole.


Change Log:

V0.53 changes:
FIXED* There was a glitch where graphics are lost and all sprites disappear during jump routines. Changed _JUMP from a GOSUB to a GOTO and RETURN to a GOTO _SPIDLE effectively by-passing any chance of creating the condition that was causing this. I HOPE. all my tests conclude this is fixed.
V0.52 changes:
FIXED* Weapons not working against zombies on bottom level of board.
FIXED* There is a glitch where graphics are lost and all sprites disappear.
FIXED* Bonus level every 10 levels starting at 90.

 

V0.51 changes:
Continued over-all code optimization. Optimize variables - reduce & reuse - focus on reducing ram requirements.
New optimized collision detection checks.
Zombi max speed and health increased at level 50.
Alternate between Zombie movement and Zombie collision detection for better performance.
Gutted out LO0T array and recoded combat coincs to conserve ram.
Zeds now turn around with loot collision instead of walking over weapons for better performance.
Bonus level every 10 levels (not tested)
90 - all zeds
80 - all zeds
70 - all hearts
60 - all ranged
50 - all melee
40 - all zeds
30 - all hearts
20 - all ranged
10 - all melee
FIXED* zed va ranged loot no good. glitch with heartz bug reproducible.
FIXED* Bullet Issues - visibility & collision issue.
FIXED* NO ZED MOVEMENT DURING PLAYER JUMP?
FIXED* No zed coinc during player fall.
FIXED* Random loot throughout game will give multiple times.
FIXED* When a lot of zombies on screen:
FIXED* one of two on the same level = 1 Zombi will walk over holes.
FIXED* Super slow performance during COINC checks and not turning around. Not so bad otherwise.
FIXED* zed self collide get teleported to top level again. This darn glitch is back. Need to figure it out again.
CHANGED - Zombies will not be able to change levels and there will be no crawler zombie due to 4 sprite per line limit. Maybe I'll make an f18a version.
V0.50 changes:
Fixed player/zombi collisions.
Adjusted jumping animation
Fixed double delay On instruction screen.
Fixed .bin file issue that would crash classic99 and real iron upon load.
It was a typo that made it through the assembly process.
Fixed - Player can no longer hold jump button and skip across holes.

 

V0.49 changes:

More code optimizations. Namely in cleaning up and reducing variables.
More source code comments.
Removed looting delay for all items.
Adjusted jump delay to discourage jump abuse.
Increased player running speed by 2 (Doubling it).
Adjusted Zombie hole collision turn around distance.
Found and removed zombi random speed change at every cycle. This code was supposed to only be present when a Zombi is created
and when a Zombi hits a hole to turn around or fall.
Fixed Melee attack animation frame issue.
Complete rework of all coinc routines resulting in huge performance gains.
Number of Zombis no longer crushes performance.
New arrays, one per loot item and one for all loot.

 

V0.48 changes:
Title and Instruction screens, move joystick to continue as well as hitting enter (for easy use on real consoles)
Rewrote instructions for ranged.
Changed girder graphics.
Zeds at level 50 will fall to lower level as player descends.
A lot more comments being added to source code.
Fixed YAD screen goes to high score and not reset game.
Fixed animation issues.
Reassign charcodes to optimize animation performance.
This broke everything and require going through all
lines of code with a fine toothed comb. Which revealed
many other bugs in the code that went undiscovered until
now. Too many bug fixes to list when everything breaks.
All items are now re-coded and fixed.

 

V0.47 changes:
Fixed dodging zed attacks.
Removed player to zed coinc checks as we now have zed to player coinc checks. (more efficient)
Adjusted Zombi attack rate..

 

V0.46 changes:
Added more delay before jump.
Added more delay at loot.
Added a lot more comments to source code.
Added 3 power ups to assist as things get difficult. At level 75 a health power up that will double your max health.
At level 50 a ranged weapon power up that will double your capacity to 20. at level 25 a weapon power up that will double your melee weapon capacity to 20.
At level 50 zombie health is increased by 50%
At Level (board) 66 existing zombies will try to match the player's X position as best it can (chase the player) when on the same level
At level 33 all zeds chase the player regardless of level they are on.
Added framework for crawler.

 

V0.45 changes:
added more delay after jump. *needs more delay
added delay at loot. *needs more delay
zombies continue to move during player fall.
*Fixed* High Score display between levels and at You Are Dead screens.
Zombies destroy hearts upon contact.
Rewrote the collisions a bit at the expense of performance. Will optimize in beta.

 

V044 changes:
Player starts game with full inventory. *Testing this out may revert to no inventory again*
Rearranged source code for better readability (flow).
Loot balanced to 25%
Highscore YAD screen WIP. Needs a display at for actual score and test it first.
*FIXED*Can't figure out why HSCORE not remaining.
*FIXED* character Shooting stance
*FIXED* last zed freezing when another zed killed. Zed teleporting to level1 - This was a bvuig related to how I was dealing with arrays.
*FIXED* Melee attacks at far edge of levels could produce an out of range y coordinate for melee weapon attack sprite call.
*FIXED* Bug in the way melee was being checked for coinc with loot AND ZEDS.
*FIXED* a lot of bugs that were created by fixing previous bugs. too many to list.

 

V043 changes:
Improvements to jumping. Rewrote jumping behaviour.
Title and instruction screen delay. To prevent skipping over instructions if ketpress not released soon enough.
Ranged fixed (issues pertaining to bullets)- Completely rewrote the ranged attack routine.
Bullets now destroy loot.
*FIXED* No points for shooting zombies. You were getting points - the gui wasn't updating at kill time.
*FIXED* Zombie health still at 2 hitpoints. Zombies noe have 4 hitpoints to start. 2 ranged shots or 4 melee to take one down.
*FIXED* Need to spawn more zeds at begining of game - Adjusted Zombie and Loot balance
*FIXED* Holes destroy bullets. - bullets now pass over holes..
Small chance a bullet will miss a Zombie.

 

V042 changes:
YOU ARE DEAD screen *fixed*
Zombie walking animations *fixed*
High Score displayed @death & level progression
IDLE Step timer added - every (Board*2) steps, minus 1 point (encourages urgency).
Bullets destroy loot
Loot distribution balance adjusted - still testing.
Gave Zombies more health.
V041 changes:
First iteration of Title and instruction screens are in game. YOU ARE DEAD screen reworked but incomplete.

 

V040 changes:
Zombie Health is now per zed. Currently 2hp. melee does 1, ranged does 2.
Ranged weapons have no effect at close range and very long range. Find the sweet spot or miss.
melee graphics changed.
zed movement is now per zed with varying speeds.
Loot distribution now evenly balanced, needs some tweaking.
More code reduction and optimizing related to loot distribution and ranged combat.
Loot balance issue - only guns lower than level 93 - FIXED
Ded Zed - Sometimes Zombies spawn and do not move. - FIXED
Zombies freeze during jumps. Can freeze them in time by holding jump button. - FIXED

 

V039 changes:

V039 changes:
Zeds move! And that kills performance to the point that it cannot be played in Extended basic. So from this version on I'm including the TiBit source and Extended Basic source for review and include EA5 files and a .bin for use in flashrom99.

If you want to play it in emulation, load the Editor Assembly Cartridge, option 5 load DSKx.ZOMBI39-A

Gave player and zombies ability to exit sides of screen via doors to roll over the opposite side of screen. This eliminated a lot of over head and improved performance.

Completely redid zed and charecter movement. It's not as smooth but it solves all colisions issues and it feels right for the game.

fIXED BULLET VS zED ISSUES - SOME REMAIN.

V038 changes:
More code ops as I add more code.

Side edge of screen glitch fixed. (Players could traverse the level by jumping and holding the joystick direction at the same time*not anymore)

Much improved collisions and movement.

Zombie spawn frequency adjusted.


V 0.37 changes:

Regained sprite by not using sprite for level exit.. Call hchar instead. COINC handled by screen position check.

Loot balancing with board progression. (game balancing)

More code optimizations:

v37 after OLD (load): 6992 program free. 6992 stack
v37 after RUN: 10606 stack free, 6000 program free.

V 0.36 changes:
Continued code optimizing.
Also, Last version had label issues. It was a typo issue on my part using TidBit. I didn't think I uploaded that version since it was fixed prior to uploading v0.35.
So here's 0.36 without the game crushing error.

V 0.35 changes:

Continued code optimizing.
Console Ram: 24488 Program.
v34 after OLD (load): 3797 program free.
v34 after RUN: 2829 program free.
v35 after OLD (load): 6734 PROGRAM FREE
v34 after RUN: 6590 PROGRAM FREE

V 0.34 changes:
Added placeholders for moving zombies.
Changed level count to reflect count down.
Changed ExX in GUI to Level
99 levels to complete,
Optimized a lot of code (Still a lot more to do)
Moved development to TidBit (see source in zip)
Console Ram: 11840 Stack, 24488 Program.
v33 after OLD (load): 1554 program free.
v33 after RUN: 10039 stack free, 730 program free.
v34 after OLD (load): 3797 program free.
v34 afterEUN: 10644 stack free, 2829 program free.

V 0.33 changes:
Added ranged weapon attacks
Added more sounds
Cleaned up all code comments and recoded an bunch of mistakes.

V032 changes:
Fixed Melee COINC issue caused by me debugging unrelated things.
Added Zombie Hit indicator (Zombie flashes red when hit)
Added more sounds

V030 changes:
Can jump while running.
improved running speed.
Re-Wrote Loot distribution and collision code and then fixed everything that I broke as a result.
Fixed GUI display issue when ranged is full causing wrap around of value on the display.
looting and zombie attacks slow you down.
Added sounds for falling and loot pickup.

Version 029 changes (*8/19/16) :
Started high score frame work..
Zeds no longer die when in contact with player. Must be killed with Melee or Dodged for now.
Added some sounds.
ADJUSTED SCORING
Fixed issue running across bottom floor caused by unused hole spawning there.
Optimize COINC calls in regards to man vs loot and man vs wall.

UNRELEASED:

V028 changes:
Major inefficiencies in dealing with sprites and sprite generation resolved
Optimized coinc calls for better performance in regards to melee coinc detection
Melee weapon attack system completed.
Version 027 changes (*8/18/16) - X=Quit, R=Reset, J and Controller Button = Jump, Joystick Left/Right moves left/right,
Joystick up = melee attack temporarily using just a high pitched sound for place holder.
Joystick down = ranged attack temporarily using a noise for place holder.
Adjusted running animations slightly. Set up weapon inventory.
Entered new CHAR patterns and codes for ZEDS and combat.
Setup empty framework for zed coinc and combat.

version 0.26-081516
Level Progression Working with new GUI element. *Pushing Joystick up or down RESETS the game. Board progression works via the EXIT.
Zombies do -1 heart/health damage. 0 health = death. Hearts = +1 health, 10 max.
FIXED*Sometimes holes don't spawn where holes are supposed to spawn causing a "no exit" situation. I dunno why yet.
FIXED*Sometimes loot doesn't spawn where it is supposed to. I dunno why yet.
FIXED*Sometimes the player falls through the girders near or very far from the hole. I dunno why yet.
New death screen. When at this screen, press any key, move joystick to push joystick button to play again.

V030 changes:
Can jump while running.
improved running speed.
Re-Wrote Loot distribution and collision code and then fixed everything that I broke as a result.
Fixed GUI display issue when ranged is full causing wrap around of value on the display.
looting and zombie attacks slow you down.
Added sounds for falling and loot pickup.

post-47352-0-22617100-1475889177_thumb.png

ZOMBiV054beta.zip

Edited by Sinphaltimus
  • Like 6
Link to comment
Share on other sites

Looks like you are having a lot of fun! :-)

 

Just a few comments are I read through this:

 

* If you use [ spoiler ] tags around your [ code ] tags (without the spaces of course) in your post, the spoiler tags will collapse the code so it does not make for really long scrolling posts.

 

* You might find TidBit helpful for BASIC/XB programming: http://codehackcreate.com/archives/237

 

* During sections of your code where you are animating a jump, etc. (i.e. line 1180 - 1220) your game will be locked up and can do nothing but control the animation. You might want to look into the idea of a "game loop" to allow you to control multiple objects in your game concurrently.

  • Like 1
Link to comment
Share on other sites

Looks like you are having a lot of fun! :-)

 

Just a few comments are I read through this:

 

* If you use [ spoiler ] tags around your [ code ] tags (without the spaces of course) in your post, the spoiler tags will collapse the code so it does not make for really long scrolling posts.

 

* You might find TidBit helpful for BASIC/XB programming: http://codehackcreate.com/archives/237

 

* During sections of your code where you are animating a jump, etc. (i.e. line 1180 - 1220) your game will be locked up and can do nothing but control the animation. You might want to look into the idea of a "game loop" to allow you to control multiple objects in your game concurrently.

Great tip for the spoilers - thanks.

I will def check out that resource, thanks.

Jump animation - yes, this is by design. At least for now. I went another route where the jump could be interrupted and things got real laggy so I cut it out...for now. For this kind of game though, it's like, you commit to the jump. Pass or fail. One bug I have is that it doesn't multi-jump until after you move left or right after a jump. I've got that on my bug list for later.

 

I'm gearing up some more code. I now have this...

 

 

 

 

 
 
100 CALL CLEAR
110 CALL SCREEN(2)
120 RANDOMIZE
130 CALL COLOR(9,15,1):: CALL COLOR(2,14,1)
140 YP=9 :: XP=15 :: RS=0 :: CS=16 !start position direction and velocity
150 GRND=17 :: LVL=3 :: SHL=2 !current ground level on top girder (YP+8pixels)
160 !running patterns right
170 DATA 1818101010101018,1818183C1C142630,181A3C5E1A334060,18197E981C724100,18197E9818147243,1818385E581C2436
180 !stop and jump right
190 DATA 1818101010101018,000C1C3058081018,00000C1C305C1C18,0000060E183C0C18,0003070C18081018
200 !jumping right
210 DATA 0303040609081010,1818141810106000,1818103810180C00,1818503010180404
220 !landing right
230 DATA 0018183050180818,1818101038501018
240 !running patterns left
250 DATA 1818080808080818,1818183C3828640C,18583C7A58CC0206,18987E19384E8200,18987E1918284EC2,18181C7A1A38246C
260 !stop and jump left
270 DATA 1818080808080818,0030380C1A100818,000030380C3A3818,00006070183C3018,00C0E03018100818
280 !jumping left
290 DATA C0C0206090100808,1818281808080600,1818081C08183000,18180A0C08182020
300 !landing right
310 DATA 0018180C0A181018,181808081C0A0818
320 FOR CHRR=40 TO 45 !setup for creating running characters right
330 READ PAT$
340 CALL CHAR(CHRR,PAT$)
350 NEXT CHRR
360 REM CHR=CHRR
370 FOR CHSR=46 TO 50 !setup for creating stop and jump characters right
380 READ PAT$
390 CALL CHAR(CHSR,PAT$)
400 NEXT CHSR
410 FOR CHJR=51 TO 54 !setup for creating jumping characters right
420 READ PAT$
430 CALL CHAR(CHJR,PAT$)
440 NEXT CHJR
450 FOR CHLR=56 TO 56 !setup for creating landing characters right
460 READ PAT$
470 CALL CHAR(CHLR,PAT$)
480 NEXT CHLR
490 REM left running***********************
500 FOR CHRL=57 TO 62 !setup for creating running characters left
510 READ PAT$
520 CALL CHAR(CHRL,PAT$)
530 NEXT CHRL
540 FOR CHSL=63 TO 67 !setup for creating stop and jump characters left
550 READ PAT$
560 CALL CHAR(CHSL,PAT$)
570 NEXT CHSL
580 FOR CHJL=68 TO 71 !setup for creating jumping characters left
590 READ PAT$
600 CALL CHAR(CHJL,PAT$)
610 NEXT CHJL
620 FOR CHLL=72 TO 73 !setup for creating landing characters left
630 READ PAT$
640 CALL CHAR(CHLL,PAT$)
650 NEXT CHLL
660 BGIR$="3C4426D999A5C3FF" !BAD girder for level HOLE creation
670 GIR$="FFC3A59999A5C3FF" !GIRDER FOR LEVELS
680 CALL CHAR(101,BGIR$,100,GIR$)!girder for level creation
690 GRAV$="FFFFFFFFFFFFFFFF" :: CALL CHAR(126,GRAV$)!THE HOLE
700 GOSUB 1860 !*******************************Create Level
710 REM******Create Sprite Idle********
720 CALL SPRITE(#1,CHRR,6,YP,XP)
730 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
740 IF JY=0 THEN 750 ELSE 2100
750 GOSUB 2020 !fall check
760 IF S=0 THEN 1400 !no kb pressed check for joyst
770 REM ********jump routine check********
780 CALL MOTION(#1,0,0)
790 IF CS<>-16 THEN 830
800 CALL POSITION(#1,YP,XP)!get new position for next sprite
810 GOSUB 870 ! goto jump left
820 GOTO 710
830 IF CS<>16 THEN 1400
840 CALL POSITION(#1,YP,XP)!get new position for next sprite
850 GOSUB 1140 !goto jump right**************************
860 GOTO 710
870 REM *************jump left routine*********
880 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running!
890 CALL SPRITE(#1,CHSL,6,YP,XP)!recreate sprite1 as stop and jump characters
900 FOR PT=63 TO 67 !setup stop and jump animation
910 CALL PATTERN(#1,PT)!ANIMATE
920 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
930 NEXT DELAY
940 NEXT PT !continue animating the stop and jump until done
950 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping
960 CS=-20 :: YP=YP-3
970 CALL SPRITE(#1,CHJL,6,YP,XP,RS,CS)!recreat sprite 1 as jumping characters and put in to motion
980 FOR PT=68 TO 71 !setup jumping characters left
990 CALL PATTERN(#1,PT)
1000 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1010 NEXT DELAY
1020 NEXT PT
1030 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1040 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1050 YP=YP+3 !RESET YP TO BE GROUND.
1060 CALL SPRITE(#1,CHLL,6,YP,XP)
1070 FOR PT=72 TO 73 !setup landing animation left
1080 CALL PATTERN(#1,PT)
1090 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1100 NEXT DELAY
1110 NEXT PT ! continue landing animation until last frame
1120 CALL POSITION(#1,YP,XP)!get new position for next sprite
1130 RETURN
1140 REM *************jump right routine******
1150 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running! right
1160 CALL SPRITE(#1,CHSR,6,YP,XP)!recreate sprite1 as stop and jump characters right
1170 FOR PT=46 TO 50 !setup stop and jump animation right
1180 CALL PATTERN(#1,PT)
1190 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1200 NEXT DELAY
1210 NEXT PT !continue animating the stop and jump until done right
1220 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping right
1230 CS=20 :: YP=YP-3 :: CALL SPRITE(#1,CHJR,6,YP,XP,RS,CS)!recreat sprite 1 as jumping characters and put in to motion right
1240 FOR PT=51 TO 54 !setup jumping characters right
1250 CALL PATTERN(#1,PT)
1260 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1270 NEXT DELAY
1280 NEXT PT
1290 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1300 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1310 YP=YP+3
1320 CALL SPRITE(#1,CHLR,6,YP,XP)
1330 FOR PT=56 TO 56 !setup landing animation
1340 CALL PATTERN(#1,PT)
1350 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1360 NEXT DELAY
1370 NEXT PT ! continue landing animation until last frame
1380 CALL POSITION(#1,YP,XP)!get new position for next sprite
1390 RETURN
1400 REM **************Check Joyst Options************
1410 IF JX<>0 THEN 1440
1420 CALL MOTION(#1,0,0)
1430 GOTO 730
1440 REM ********running check***************
1450 IF JX<>-4 THEN 1480
1460 CALL POSITION(#1,YP,XP)!get new position for next sprite
1470 GOSUB 1680
1480 IF JX<>4 THEN 730
1490 CALL POSITION(#1,YP,XP)!get new position for next sprite
1500 GOSUB 1520
1510 GOTO 730 !after RETURN goto joyst check
1520 REM ************run right routine********
1530 CS=16 :: CALL SPRITE(#1,CHRR,6,YP,XP)!create the runner and send running
1540 CALL MOTION(#1,0,JX*4)
1550 FOR PT=40 TO 45 !setup for animating the run
1560 CALL PATTERN(#1,PT)
1570 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
1580 CALL COINC(ALL,C):: IF C=0 THEN 1600 ELSE 1590
1590 GOSUB 2020 !fall check
1600 IF JX<>0 THEN 1620 ELSE 1610 !not joy pressed keep running
1610 CALL MOTION(#1,0,0):: RETURN
1620 IF JX=4 THEN 1640
1630 IF JX=-4 THEN 1670
1640 NEXT PT
1650 IF JX=4 THEN 1550
1660 CALL POSITION(#1,YP,XP)!check position and store before stopping motion
1670 RETURN
1680 REM **********run left routine**************
1690 CS=-16 :: CALL SPRITE(#1,CHRL,6,YP,XP)!create the runner and send running
1700 CALL MOTION(#1,0,JX*4)
1710 FOR PT=57 TO 62 !setup for animating the run
1720 CALL PATTERN(#1,PT)
1730 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
1740 CALL COINC(ALL,C):: IF C=0 THEN 1760 ELSE 1750
1750 GOSUB 2020 !fall check
1760 IF JY=0 THEN 1770 ELSE 2100
1770 IF JX<>0 THEN 1790 ELSE 1780 !not joy pressed keep running
1780 CALL MOTION(#1,0,0):: RETURN
1790 IF JX=-4 THEN 1810
1800 IF JX=4 THEN 1840
1810 NEXT PT
1820 IF JX=-4 THEN 1700
1830 CALL POSITION(#1,YP,XP)!check position and store for next sprite
1840 RETURN
1850 REM ******************level creation************************
1860 HLE=INT((RND*15)+5)
1870 FOR LVL=3 TO 21 STEP 3
1880 CALL VCHAR(1,1,100,24)
1890 CALL VCHAR(1,28,100,24)
1900 CALL HCHAR(LVL,1,100,HLE-1)
1910 CALL SPRITE(#SHL,126,1,GRND-3,(HLE*+1)
1920 CALL HCHAR(LVL,HLE+3,100,28-(HLE+3))
1930 CALL HCHAR(LVL,HLE,101)
1940 CALL HCHAR(LVL,HLE+2,101)
1950 GRND=GRND+24 :: HOL=INT((RND*15)+5)
1960 IF HOL=HLE THEN 1950
1970 HLE=HOL
1980 SHL=SHL+1
1990 NEXT LVL
2000 HLE=INT((RND*10)+10)
2010 RETURN
2020 REM *************fall check*******
2030 CALL POSITION(#1,YP,XP)
2040 FOR DET=2 TO 8
2050 CALL COINC(#1,#DET,6,C)
2060 IF C<>0 THEN 2080 ELSE 2070
2070 NEXT DET :: GOTO 2090
2080 FOR FALL=1 TO 24 :: YP=YP+1 :: CALL SPRITE(#1,CHRR,6,YP,XP):: NEXT FALL
2090 RETURN
2100 REM ***********DEMO RESET*************
2110 CALL DELSPRITE(ALL)
2120 RESTORE 170
2130 GOTO 100
 
 

 

 

 

 

Link to comment
Share on other sites

OK the redundancy part: Joystick required. Left right only. Up and down will reset the demo which is exactly what happens when you reach the exit. Fall down holes to reach the next level. You can jump over holes if you want to. In the future, you will need to in order to get perks like a weapon or a bonus life or something that will make jumping over the hole worth while. Run with cpu throttle at normal do not overclock. Speeding up cpu performance has a direct negative impact on the jump distances.

Boards are randomly generated.

 

 
100 CALL CLEAR
110 CALL SCREEN(2)
120 RANDOMIZE
130 CALL COLOR(9,15,1):: CALL COLOR(2,14,1)
140 YP=9 :: XP=15 :: RS=0 :: CS=16 !start position direction and velocity
150 GRND=17 :: LVL=3 :: SHL=2 !START ground level on top girder (YP+8pixels), LEVEL AND SPRITE HOLE #
160 !running patterns right
170 DATA 1818101010101018,1818183C1C142630,181A3C5E1A334060,18197E981C724100,18197E9818147243,1818385E581C2436
180 !stop and jump right
190 DATA 1818101010101018,000C1C3058081018,00000C1C305C1C18,0000060E183C0C18,0003070C18081018
200 !jumping right
210 DATA 0303040609081010,1818141810106000,1818103810180C00,1818503010180404
220 !landing right
230 DATA 0018183050180818,1818101038501018
240 !running patterns left
250 DATA 1818080808080818,1818183C3828640C,18583C7A58CC0206,18987E19384E8200,18987E1918284EC2,18181C7A1A38246C
260 !stop and jump left
270 DATA 1818080808080818,0030380C1A100818,000030380C3A3818,00006070183C3018,00C0E03018100818
280 !jumping left
290 DATA C0C0206090100808,1818281808080600,1818081C08183000,18180A0C08182020
300 !landing right
310 DATA 0018180C0A181018,181808081C0A0818
320 FOR CHRR=40 TO 45 !setup for creating running characters right
330 READ PAT$
340 CALL CHAR(CHRR,PAT$)
350 NEXT CHRR
360 REM CHR=CHRR
370 FOR CHSR=46 TO 50 !setup for creating stop and jump characters right
380 READ PAT$
390 CALL CHAR(CHSR,PAT$)
400 NEXT CHSR
410 FOR CHJR=51 TO 54 !setup for creating jumping characters right
420 READ PAT$
430 CALL CHAR(CHJR,PAT$)
440 NEXT CHJR
450 FOR CHLR=56 TO 56 !setup for creating landing characters right
460 READ PAT$
470 CALL CHAR(CHLR,PAT$)
480 NEXT CHLR
490 REM left running***********************
500 FOR CHRL=57 TO 62 !setup for creating running characters left
510 READ PAT$
520 CALL CHAR(CHRL,PAT$)
530 NEXT CHRL
540 FOR CHSL=63 TO 67 !setup for creating stop and jump characters left
550 READ PAT$
560 CALL CHAR(CHSL,PAT$)
570 NEXT CHSL
580 FOR CHJL=68 TO 71 !setup for creating jumping characters left
590 READ PAT$
600 CALL CHAR(CHJL,PAT$)
610 NEXT CHJL
620 FOR CHLL=72 TO 73 !setup for creating landing characters left
630 READ PAT$
640 CALL CHAR(CHLL,PAT$)
650 NEXT CHLL
660 BGIR$="3C4426D999A5C3FF" !BAD girder for level HOLE creation
670 GIR$="FFC3A59999A5C3FF" !GIRDER FOR LEVELS
680 CALL CHAR(101,BGIR$,100,GIR$)!girder for level creation
690 GRAV$="FFFFFFFFFFFFFFFF" :: CALL CHAR(126,GRAV$)!THE HOLE
700 EXT$="FF9999BD999999FF" :: CALL CHAR(120,EXT$)!THE EXIT
710 GOSUB 1900 !*******************************Create Level
720 REM******Create Sprite Idle********
730 CALL SPRITE(#1,CHRR,6,YP,XP)
740 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
750 IF JY=0 THEN 760 ELSE 2180
760 CALL COINC(ALL,C):: IF C=0 THEN 780 ELSE 770
770 GOSUB 2100 !fall check
780 IF S=0 THEN 1440 !no kb pressed check for joyst
790 REM ********jump routine check********
800 CALL MOTION(#1,0,0)
810 IF CS<>-16 THEN 850
820 CALL POSITION(#1,YP,XP)!get new position for next sprite
830 GOSUB 890 ! goto jump left
840 GOTO 720
850 IF CS<>16 THEN 1440
860 CALL POSITION(#1,YP,XP)!get new position for next sprite
870 GOSUB 1170 !goto jump right**************************
880 GOTO 720
890 REM *************jump left routine*********
900 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running!
910 CALL SPRITE(#1,CHSL,6,YP,XP)!recreate sprite1 as stop and jump characters
920 FOR PT=63 TO 67 !setup stop and jump animation
930 CALL PATTERN(#1,PT)!ANIMATE
940 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
950 NEXT DELAY
960 NEXT PT !continue animating the stop and jump until done
970 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping
980 CS=-20 :: YP=YP-3
990 CALL SPRITE(#1,CHJL,6,YP,XP,RS,CS)!recreat sprite 1 as jumping characters and put in to motion
1000 FOR PT=68 TO 71 !setup jumping characters left
1010 CALL PATTERN(#1,PT)
1020 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1030 NEXT DELAY
1040 NEXT PT
1050 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1060 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1070 YP=YP+3 !RESET YP TO BE GROUND.
1080 CALL SPRITE(#1,CHLL,6,YP,XP)
1090 FOR PT=72 TO 73 !setup landing animation left
1100 CALL PATTERN(#1,PT)
1110 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1120 NEXT DELAY
1130 NEXT PT ! continue landing animation until last frame
1140 CALL POSITION(#1,YP,XP)!get new position for next sprite
1150 CS=-16
1160 RETURN
1170 REM *************jump right routine******
1180 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running! right
1190 CALL SPRITE(#1,CHSR,6,YP,XP)!recreate sprite1 as stop and jump characters right
1200 FOR PT=46 TO 50 !setup stop and jump animation right
1210 CALL PATTERN(#1,PT)
1220 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1230 NEXT DELAY
1240 NEXT PT !continue animating the stop and jump until done right
1250 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping right
1260 CS=20 :: YP=YP-3 :: CALL SPRITE(#1,CHJR,6,YP,XP,RS,CS)!recreat sprite 1 as jumping characters and put in to motion right
1270 FOR PT=51 TO 54 !setup jumping characters right
1280 CALL PATTERN(#1,PT)
1290 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1300 NEXT DELAY
1310 NEXT PT
1320 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1330 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1340 YP=YP+3
1350 CALL SPRITE(#1,CHLR,6,YP,XP)
1360 FOR PT=56 TO 56 !setup landing animation
1370 CALL PATTERN(#1,PT)
1380 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1390 NEXT DELAY
1400 NEXT PT ! continue landing animation until last frame
1410 CALL POSITION(#1,YP,XP)!get new position for next sprite
1420 CS=16
1430 RETURN
1440 REM **************Check Joyst Options************
1450 IF JX<>0 THEN 1480
1460 CALL MOTION(#1,0,0)
1470 GOTO 740
1480 REM ********running check***************
1490 IF JX<>-4 THEN 1520
1500 CALL POSITION(#1,YP,XP)!get new position for next sprite
1510 GOSUB 1720
1520 IF JX<>4 THEN 740
1530 CALL POSITION(#1,YP,XP)!get new position for next sprite
1540 GOSUB 1560
1550 GOTO 740 !after RETURN goto joyst check
1560 REM ************run right routine********
1570 CS=16 :: CALL SPRITE(#1,CHRR,6,YP,XP)!create the runner and send running
1580 CALL MOTION(#1,0,JX*4)
1590 FOR PT=40 TO 45 !setup for animating the run
1600 CALL PATTERN(#1,PT)
1610 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
1620 CALL COINC(ALL,C):: IF C=0 THEN 1640 ELSE 1630
1630 CALL MOTION(#1,0,0):: CALL POSITION(#1,YP,XP):: GOSUB 2100 !fall check
1640 IF JX<>0 THEN 1660 ELSE 1650 !not joy pressed keep running
1650 CALL MOTION(#1,0,0):: RETURN
1660 IF JX=4 THEN 1680
1670 IF JX=-4 THEN 1710
1680 NEXT PT
1690 IF JX=4 THEN 1590
1700 CALL POSITION(#1,YP,XP)!check position and store before stopping motion
1710 RETURN
1720 REM **********run left routine**************
1730 CS=-16 :: CALL SPRITE(#1,CHRL,6,YP,XP)!create the runner and send running
1740 CALL MOTION(#1,0,JX*4)
1750 FOR PT=57 TO 62 !setup for animating the run
1760 CALL PATTERN(#1,PT)
1770 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
1780 CALL COINC(ALL,C):: IF C=0 THEN 1800 ELSE 1790
1790 CALL MOTION(#1,0,0):: CALL POSITION(#1,YP,XP):: GOSUB 2100 !fall check
1800 IF JY=0 THEN 1810 ELSE 2180
1810 IF JX<>0 THEN 1830 ELSE 1820 !not joy pressed keep running
1820 CALL MOTION(#1,0,0):: RETURN
1830 IF JX=-4 THEN 1850
1840 IF JX=4 THEN 1880
1850 NEXT PT
1860 IF JX=-4 THEN 1740
1870 CALL POSITION(#1,YP,XP)!check position and store for next sprite
1880 RETURN
1890 REM ******************level creation************************
1900 RESTORE 1910
1910 DATA 1.125,4.125,7.125,10.125,11.875,16.125,19.876
1920 HLE=INT((RND*15)+5)
1930 FOR LVL=1 TO 7
1940 READ HGT
1950 CALL VCHAR(1,1,100,24)!LEFT WALL
1960 CALL VCHAR(1,28,100,24)!RIGHT WALL
1970 CALL HCHAR(LVL*3,1,100,HLE-1)!LEFT SIDE GIRDERS
1980 CALL SPRITE(#SHL,126,1,GRND-3,(HLE*+1)!HOLE PROPER
1990 CALL HCHAR(LVL*3,HLE+3,100,28-(HLE+3))!CRUMBLE RIGHT SIDE
2000 CALL HCHAR(LVL*3,HLE,101)!CRUMBLE LEFT SIDE
2010 CALL HCHAR(LVL*3,HLE+2,101)!RIGHT SIDE GIRDERS
2020 GRND=GRND+24 :: HOL=INT((RND*15)+5)!NEW LOCATION FOR HOLE
2030 IF HOL=HLE THEN 2020 !NOT EQUAL TO PREVIOUS HOLE
2040 HLE=HOL !SET PROPER HOLE VARIABLE
2050 SHL=SHL+1 !ADVANCE SPRITE #
2060 NEXT LVL !GO CREATE NEXT LEVEL
2070 CALL SPRITE(#10,120,15,22*8,26*! THE EXIT
2080 CALL HCHAR(24,1,100,28)!THE FLOOR
2090 RETURN
2100 REM *************fall check*******
2110 CALL COINC(#1,#10,4,C):: IF C<>0 THEN 2180 ELSE 2120
2120 FOR DET=2 TO 8
2130 CALL COINC(#1,#DET,6,C)
2140 IF C<>0 THEN 2160 ELSE 2150
2150 NEXT DET :: GOTO 2170
2160 FOR FALL=1 TO 24 :: YP=YP+1 :: CALL SPRITE(#1,CHRR,6,YP,XP):: NEXT FALL :: GOTO 2170
2170 RETURN
2180 REM ***********DEMO RESET*************
2190 CALL DELSPRITE(ALL)
2200 RESTORE 170
2210 GOTO 100
 

 

 

Edited by Sinphaltimus
  • Like 1
Link to comment
Share on other sites

Jump animation - yes, this is by design. At least for now. I went another route where the jump could be interrupted and things got real laggy so I cut it out...for now. For this kind of game though, it's like, you commit to the jump. Pass or fail. One bug I have is that it doesn't multi-jump until after you move left or right after a jump. I've got that on my bug list for later.

Yeah, that slow/laggy response is going to be the normal in B/XB on the 99/4A due to one of the slowest BASIC implementations of all the home computers. Action games and 99/4A B/XB don't really go that well together (IMO). Now, assembly language is a different story. :-)

  • Like 2
Link to comment
Share on other sites

Yeah, that slow/laggy response is going to be the normal in B/XB on the 99/4A due to one of the slowest BASIC implementations of all the home computers. Action games and 99/4A B/XB don't really go that well together (IMO). Now, assembly language is a different story. :-)

That's my long term goal. (AL) :)

Link to comment
Share on other sites

This is a huge milestone.
I have the loot distribution system created and working, yes I include zombies in the loot category.

Right now there are 4 different types of loot. melee weapons (resembles a sword), ranged weapons (resembles a crosshair), health (a heart) and a zombie (green dude).
They are nothing more than static sprites at the moment and collecting them does nothing more than delete them.

 

 

 

 
100 CALL CLEAR
110 CALL SCREEN(2)
120 RANDOMIZE
130 CALL COLOR(9,15,1):: CALL COLOR(2,14,1):: CALL COLOR(7,7,1):: CALL COLOR(8,4,1):: CALL COLOR(10,8,1):: CALL COLOR(11,12,1)
140 YP=9 :: XP=15 :: RS=0 :: CS=16 !start position direction and velocity
150 SLOT=11 !STARTING SPRITE NUMBER FOR LOOT
160 GRND=17 :: LVL=3 :: SHL=2 !START ground level on top girder (YP+8pixels), LEVEL AND SPRITE HOLE #
170 !running patterns right
180 DATA 1818101010101018,1818183C1C142630,181A3C5E1A334060,18197E981C724100,18197E9818147243,1818385E581C2436
190 !stop and jump right
200 DATA 1818101010101018,000C1C3058081018,00000C1C305C1C18,0000060E183C0C18,0003070C18081018
210 !jumping right
220 DATA 0303040609081010,1818141810106000,1818103810180C00,1818503010180404
230 !landing right
240 DATA 0018183050180818,1818101038501018
250 !running patterns left
260 DATA 1818080808080818,1818183C3828640C,18583C7A58CC0206,18987E19384E8200,18987E1918284EC2,18181C7A1A38246C
270 !stop and jump left
280 DATA 1818080808080818,0030380C1A100818,000030380C3A3818,00006070183C3018,00C0E03018100818
290 !jumping left
300 DATA C0C0206090100808,1818281808080600,1818081C08183000,18180A0C08182020
310 !landing right
320 DATA 0018180C0A181018,181808081C0A0818
330 FOR CHRR=40 TO 45 !setup for creating running characters right
340 READ PAT$
350 CALL CHAR(CHRR,PAT$)
360 NEXT CHRR
370 REM CHR=CHRR
380 FOR CHSR=46 TO 50 !setup for creating stop and jump characters right
390 READ PAT$
400 CALL CHAR(CHSR,PAT$)
410 NEXT CHSR
420 FOR CHJR=51 TO 54 !setup for creating jumping characters right
430 READ PAT$
440 CALL CHAR(CHJR,PAT$)
450 NEXT CHJR
460 FOR CHLR=56 TO 56 !setup for creating landing characters right
470 READ PAT$
480 CALL CHAR(CHLR,PAT$)
490 NEXT CHLR
500 REM left running***********************
510 FOR CHRL=57 TO 62 !setup for creating running characters left
520 READ PAT$
530 CALL CHAR(CHRL,PAT$)
540 NEXT CHRL
550 FOR CHSL=63 TO 67 !setup for creating stop and jump characters left
560 READ PAT$
570 CALL CHAR(CHSL,PAT$)
580 NEXT CHSL
590 FOR CHJL=68 TO 71 !setup for creating jumping characters left
600 READ PAT$
610 CALL CHAR(CHJL,PAT$)
620 NEXT CHJL
630 FOR CHLL=72 TO 73 !setup for creating landing characters left
640 READ PAT$
650 CALL CHAR(CHLL,PAT$)
660 NEXT CHLL
670 BGIR$="3C4426D999A5C3FF" !BAD girder for level HOLE creation
680 GIR$="FFC3A59999A5C3FF" !GIRDER FOR LEVELS
690 CALL CHAR(101,BGIR$,100,GIR$)!girder for level creation
700 GRAV$="FFFFFFFFFFFFFFFF" :: CALL CHAR(126,GRAV$)!THE HOLE
710 EXT$="FF9999BD999999FF" :: CALL CHAR(120,EXT$)!THE EXIT
720 HRT$="66FFFFFF7E7E3C18" :: CALL CHAR(80,HRT$)!THE HEART
730 ZED$="3CA55A3C1818183C" :: CALL CHAR(88,ZED$)!THE ZED
740 MLE$="C0E070381C0E0601" :: CALL CHAR(104,MLE$)!MELEE
750 RNG$="103844D644381000" :: CALL CHAR(112,RNG$)!RANGED WEAPONS
760 GOSUB 1940 !*******************************Create Level
770 REM******Create Sprite Idle********
780 CALL SPRITE(#1,CHRR,6,YP,XP)
790 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
800 IF JY=0 THEN 810 ELSE 2280
810 CALL COINC(ALL,C):: IF C=0 THEN 830 ELSE 820 !collision check
820 GOSUB 2140 !collision actions
830 IF S=0 THEN 1490 !no kb pressed check for joyst
840 REM ********jump routine check********
850 CALL MOTION(#1,0,0)
860 IF CS<>-16 THEN 900
870 CALL POSITION(#1,YP,XP)!get new position for next sprite
880 GOSUB 940 ! goto jump left
890 GOTO 770
900 IF CS<>16 THEN 1490
910 CALL POSITION(#1,YP,XP)!get new position for next sprite
920 GOSUB 1220 !goto jump right**************************
930 GOTO 770
940 REM *************jump left routine*********
950 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running!
960 CALL SPRITE(#1,CHSL,6,YP,XP)!recreate sprite1 as stop and jump characters
970 FOR PT=63 TO 67 !setup stop and jump animation
980 CALL PATTERN(#1,PT)!ANIMATE
990 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1000 NEXT DELAY
1010 NEXT PT !continue animating the stop and jump until done
1020 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping
1030 CS=-20 :: YP=YP-3
1040 CALL SPRITE(#1,CHJL,6,YP,XP,RS,CS)!recreat sprite 1 as jumping characters and put in to motion
1050 FOR PT=68 TO 71 !setup jumping characters left
1060 CALL PATTERN(#1,PT)
1070 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1080 NEXT DELAY
1090 NEXT PT
1100 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1110 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1120 YP=YP+3 !RESET YP TO BE GROUND.
1130 CALL SPRITE(#1,CHLL,6,YP,XP)
1140 FOR PT=72 TO 73 !setup landing animation left
1150 CALL PATTERN(#1,PT)
1160 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1170 NEXT DELAY
1180 NEXT PT ! continue landing animation until last frame
1190 CALL POSITION(#1,YP,XP)!get new position for next sprite
1200 CS=-16
1210 RETURN
1220 REM *************jump right routine******
1230 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running! right
1240 CALL SPRITE(#1,CHSR,6,YP,XP)!recreate sprite1 as stop and jump characters right
1250 FOR PT=46 TO 50 !setup stop and jump animation right
1260 CALL PATTERN(#1,PT)
1270 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1280 NEXT DELAY
1290 NEXT PT !continue animating the stop and jump until done right
1300 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping right
1310 CS=20 :: YP=YP-3 :: CALL SPRITE(#1,CHJR,6,YP,XP,RS,CS)!recreat sprite 1 as jumping characters and put in to motion right
1320 FOR PT=51 TO 54 !setup jumping characters right
1330 CALL PATTERN(#1,PT)
1340 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1350 NEXT DELAY
1360 NEXT PT
1370 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1380 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1390 YP=YP+3
1400 CALL SPRITE(#1,CHLR,6,YP,XP)
1410 FOR PT=56 TO 56 !setup landing animation
1420 CALL PATTERN(#1,PT)
1430 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1440 NEXT DELAY
1450 NEXT PT ! continue landing animation until last frame
1460 CALL POSITION(#1,YP,XP)!get new position for next sprite
1470 CS=16
1480 RETURN
1490 REM **************Check Joyst Options************
1500 IF JX<>0 THEN 1530
1510 CALL MOTION(#1,0,0)
1520 GOTO 790
1530 REM ********running check***************
1540 IF JX<>-4 THEN 1570
1550 CALL POSITION(#1,YP,XP)!get new position for next sprite
1560 GOSUB 1770
1570 IF JX<>4 THEN 790
1580 CALL POSITION(#1,YP,XP)!get new position for next sprite
1590 GOSUB 1610
1600 GOTO 790 !after RETURN goto joyst check
1610 REM ************run right routine********
1620 CS=16 :: CALL SPRITE(#1,CHRR,6,YP,XP)!create the runner and send running
1630 CALL MOTION(#1,0,JX*4)
1640 FOR PT=40 TO 45 !setup for animating the run
1650 CALL PATTERN(#1,PT)
1660 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
1670 CALL COINC(ALL,C):: IF C=0 THEN 1690 ELSE 1680 !collision check
1680 CALL MOTION(#1,0,0):: CALL POSITION(#1,YP,XP):: GOSUB 2140 !collision actions
1690 IF JX<>0 THEN 1710 ELSE 1700 !not joy pressed keep running
1700 CALL MOTION(#1,0,0):: RETURN
1710 IF JX=4 THEN 1730
1720 IF JX=-4 THEN 1760
1730 NEXT PT
1740 IF JX=4 THEN 1640
1750 CALL POSITION(#1,YP,XP)!check position and store before stopping motion
1760 RETURN
1770 REM **********run left routine**************
1780 CS=-16 :: CALL SPRITE(#1,CHRL,6,YP,XP)!create the runner and send running
1790 CALL MOTION(#1,0,JX*4)
1800 FOR PT=57 TO 62 !setup for animating the run
1810 CALL PATTERN(#1,PT)
1820 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
1830 CALL COINC(ALL,C):: IF C=0 THEN 1850 ELSE 1840 !collision check
1840 CALL MOTION(#1,0,0):: CALL POSITION(#1,YP,XP):: GOSUB 2140 !collision actions
1850 IF JY=0 THEN 1860 ELSE 2280
1860 IF JX<>0 THEN 1880 ELSE 1870 !not joy pressed keep running
1870 CALL MOTION(#1,0,0):: RETURN
1880 IF JX=-4 THEN 1900
1890 IF JX=4 THEN 1930
1900 NEXT PT
1910 IF JX=-4 THEN 1790
1920 CALL POSITION(#1,YP,XP)!check position and store for next sprite
1930 RETURN
1940 REM ******************level creation************************
1950 HLE=INT((RND*15)+5)
1960 FOR LVL=1 TO 7
1970 IF LVL=1 THEN 1990
1980 GOSUB 2320 !******LOOT**********
1990 CALL VCHAR(1,1,100,24)!LEFT WALL
2000 CALL VCHAR(1,28,100,24)!RIGHT WALL
2010 CALL HCHAR(LVL*3,1,100,HLE-1)!LEFT SIDE GIRDERS
2020 CALL SPRITE(#SHL,126,1,GRND-3,(HLE*+1)!HOLE PROPER
2030 CALL HCHAR(LVL*3,HLE+3,100,28-(HLE+3))!CRUMBLE RIGHT SIDE
2040 CALL HCHAR(LVL*3,HLE,101)!CRUMBLE LEFT SIDE
2050 CALL HCHAR(LVL*3,HLE+2,101)!RIGHT SIDE GIRDERS
2060 GRND=GRND+24 :: HOL=INT((RND*15)+5)!NEW LOCATION FOR HOLE
2070 IF HOL=HLE THEN 2060 !NOT EQUAL TO PREVIOUS HOLE
2080 HLE=HOL !SET PROPER HOLE VARIABLE
2090 SHL=SHL+1 !ADVANCE SPRITE #
2100 NEXT LVL !GO CREATE NEXT LEVEL
2110 CALL SPRITE(#10,120,15,22*8,26*! THE EXIT
2120 CALL HCHAR(24,1,100,28)!THE FLOOR
2130 RETURN
2140 REM *************collision action*******
2150 CALL COINC(#1,#10,4,C):: IF C<>0 THEN 2280 ELSE 2160 !collision check against exit
2160 FOR DET=2 TO 8
2170 CALL COINC(#1,#DET,6,C)!collision check against holes
2180 IF C<>0 THEN 2260 ELSE 2190
2190 NEXT DET
2200 FOR DET=10 TO SLOT
2210 CALL COINC(#1,#DET,6,C)!collision check against LOOT
2220 IF C<>0 THEN 2230 ELSE 2240
2230 CALL DELSPRITE(#DET):: GOTO 2270 !TEMP CODE - NEED TO GET PATTERNS TO IDENTIFY LOOT BEFORE BEHAVIOUR
2240 NEXT DET
2250 GOTO 2270
2260 FOR FALL=1 TO 24 :: YP=YP+1 :: CALL SPRITE(#1,CHRR,6,YP,XP):: NEXT FALL
2270 RETURN
2280 REM ***********DEMO RESET*************
2290 CALL DELSPRITE(ALL)
2300 RESTORE 180
2310 GOTO 100
2320 REM *********LOOT DISTRIBUTION SYSTEM******
2330 SWITCH=INT(RND*2)+1
2340 FOR LT=1 TO 2
2350 LOOT=INT(RND*4)+1
2360 IF SWITCH=1 THEN SWITCH=-5
2370 IF SWITCH=2 THEN SWITCH=5
2380 IF SWITCH=5 THEN SWITCH=-5 ELSE SWITCH=5
2390 IF LOOT<>1 THEN 2410
2400 CALL SPRITE(#SLOT,80,7,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !HEART LOOT
2410 IF LOOT<>2 THEN 2430
2420 CALL SPRITE(#SLOT,88,4,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !ZED
2430 IF LOOT<>3 THEN 2450
2440 CALL SPRITE(#SLOT,104,8,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !MELEE
2450 IF LOOT<>4 THEN 2470
2460 CALL SPRITE(#SLOT,112,12,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !RANGED
2470 NEXT LT
2480 RETURN
 

 

 

Edited by Sinphaltimus
  • Like 2
Link to comment
Share on other sites

BTW, I second Matthew's TIdBiT suggestion. Makes ALL the difference in the world. :D

 

I don't feel like I've earned my programming wings.

I know what little I know with TI-basic and XB and am more comfortable coding in B/XB than a more modern approach that gets translated. That's just me and my confidence level.

 

I'm probably intermediate level with GML which is Game Maker Language (Way higher level than this stuff).

And I'm ok around command prompts and bashes of any kind.

 

The TI Started me on Coding and by the time I got an Amiga I didn't need to code the programs I wanted anymore. I could buy other peoples programs and then just get to work on the art whether Audio, Visual or both.

The Amiga brought me in to 3D animation mostly but it also fostered audio. I never had the urge to code on the Amiga at all.

With the PC, Besides a career in IT, as a hobbyist, I am in to game development for Android. May do something for PC but it's all via Game Maker Studio.

As creative visual person I needed to learn some coding to make the art and games I wanted to create. Now I want to create more and learn more coding.

 

So for inspiration and exploration, I came back to where it all started. Literally getting back to the BASICs. And now I'm motivated enough to be doing hardware mods and creating more apps.

I am going to start learning Assembly within a month or two. That maybe something I'll carry over and do on the Amiga way later. I believe it will make me a better programmer and technical artist over-all.

 

If I'm wrong, I'm having a ton of fun being it. If I'm right, there's a lot more fun to be had with the TI and more.

 

 

Link to comment
Share on other sites

I was a bit worried (at 7 kilobytes (K) using the Size command) that you'd run out of memory before this coming close to a game, but you did it (at 10 K). There are ways to reduce your code size, like merging the run right and run left routines etc., but with your new level generation and ambition to start Assembly soon, I think you'll be just fine.

 

I like your animation, but somehow the standing still graphic seems to need a bit more body / volume. Again, it's hard to make a stick figure in 8 by 8 pixels. Maybe he should simply face the player / background ?

 

Very nice. :thumbsup:

  • Like 1
Link to comment
Share on other sites

 

I don't feel like I've earned my programming wings.

I know what little I know with TI-basic and XB and am more comfortable coding in B/XB than a more modern approach that gets translated. That's just me and my confidence level.

 

 

Don't let the name mislead you. TidBit is *not* any new language, etc., you are still programming 100% in B/XB. TidBit primarily lets you code without fussing with line numbers, lets you indent your B/XB code, add comments without using REM (REM and the single-quote comment consume real memory on the 99/4A), and use labels instead of line numbers. It is totally about code formatting and readability. Also since you don't have to worry about the line numbers in your source, you can move things around really easily and let the tool take care of the line numbers.

  • Like 1
Link to comment
Share on other sites

 

Don't let the name mislead you. TidBit is *not* any new language, etc., you are still programming 100% in B/XB. TidBit primarily lets you code without fussing with line numbers, lets you indent your B/XB code, add comments without using REM (REM and the single-quote comment consume real memory on the 99/4A), and use labels instead of line numbers. It is totally about code formatting and readability. Also since you don't have to worry about the line numbers in your source, you can move things around really easily and let the tool take care of the line numbers.

 

While probably the wrong way to describe it, I see using TidBit as a kind-of "structured XB pseudo-code hybrid." (Now, if someone would create a real pseudo-code translator which could produce output in any language... that would be awesome.)

 

I "translated" a couple of old programs I wrote in my teens in the 80s into TidBit code and the difference in just being able to edit was incredible (I believe that would fall under readability.) In addition, in-line with the lack of line numbers, it allows for a much easier modular coding approach to your BASIC programs -- similar to if you ever programmed in GFA Basic, AmigaBasic, or any other similar structured BASIC.

 

In short: highly recommended.

  • Like 3
Link to comment
Share on other sites

OK, nothing here changes as far as game play. However; this is another milestone revision.

I never really wrapped my head around arrays (I know right) until today. Since I'm generating loot randomly, i have no way of knowing what loot type the player is COINC with. I had to figure out how to use an array to store the needed attributes I figure I will need to identify each individual loot item after it has been created. For me,this is a huge leap forward in my coding capabilities. And they are so simple to understand. Not complex at all. Not sure why I've always had a problem with them.

Anyway, here is the subsystem for the coming scoring system .
The first few lines I create the array and variables

The bottom section of code (loot distribution system) is where I record the location and types of loot being distributed.

Next, I'll use the COINC to find the correct loot item in the array using the Sprite number and location. This wont work with zombies once I start moving them but they aren't collectible loot either and will behave differently within the scoring and COINC behaviors.

 

So that's it for this version.

 

 
100 OPTION BASE 1
110 DIM LO0T(5,14)
120 LTN=1 !LOOT ARRAY COORDS COL
130 LAB=1 !LOOT ARRAY COORDS ROW
140 CALL CLEAR
150 CALL SCREEN(2)
160 RANDOMIZE
170 CALL COLOR(9,15,1):: CALL COLOR(2,14,1):: CALL COLOR(7,7,1):: CALL COLOR(8,4,1):: CALL COLOR(10,8,1):: CALL COLOR(11,12,1)
180 YP=9 :: XP=15 :: RS=0 :: CS=16 !start position direction and velocity
190 SLOT=11 !STARTING SPRITE NUMBER FOR LOOT
200 GRND=17 :: LVL=3 :: SHL=2 !START ground level on top girder (YP+8pixels), LEVEL AND SPRITE HOLE #
210 !running patterns right
220 DATA 1818101010101018,1818183C1C142630,181A3C5E1A334060,18197E981C724100,18197E9818147243,1818385E581C2436
230 !stop and jump right
240 DATA 1818101010101018,000C1C3058081018,00000C1C305C1C18,0000060E183C0C18,0003070C18081018
250 !jumping right
260 DATA 0303040609081010,1818141810106000,1818103810180C00,1818503010180404
270 !landing right
280 DATA 0018183050180818,1818101038501018
290 !running patterns left
300 DATA 1818080808080818,1818183C3828640C,18583C7A58CC0206,18987E19384E8200,18987E1918284EC2,18181C7A1A38246C
310 !stop and jump left
320 DATA 1818080808080818,0030380C1A100818,000030380C3A3818,00006070183C3018,00C0E03018100818
330 !jumping left
340 DATA C0C0206090100808,1818281808080600,1818081C08183000,18180A0C08182020
350 !landing right
360 DATA 0018180C0A181018,181808081C0A0818
370 FOR CHRR=40 TO 45 !setup for creating running characters right
380 READ PAT$
390 CALL CHAR(CHRR,PAT$)
400 NEXT CHRR
410 REM CHR=CHRR
420 FOR CHSR=46 TO 50 !setup for creating stop and jump characters right
430 READ PAT$
440 CALL CHAR(CHSR,PAT$)
450 NEXT CHSR
460 FOR CHJR=51 TO 54 !setup for creating jumping characters right
470 READ PAT$
480 CALL CHAR(CHJR,PAT$)
490 NEXT CHJR
500 FOR CHLR=56 TO 56 !setup for creating landing characters right
510 READ PAT$
520 CALL CHAR(CHLR,PAT$)
530 NEXT CHLR
540 REM left running***********************
550 FOR CHRL=57 TO 62 !setup for creating running characters left
560 READ PAT$
570 CALL CHAR(CHRL,PAT$)
580 NEXT CHRL
590 FOR CHSL=63 TO 67 !setup for creating stop and jump characters left
600 READ PAT$
610 CALL CHAR(CHSL,PAT$)
620 NEXT CHSL
630 FOR CHJL=68 TO 71 !setup for creating jumping characters left
640 READ PAT$
650 CALL CHAR(CHJL,PAT$)
660 NEXT CHJL
670 FOR CHLL=72 TO 73 !setup for creating landing characters left
680 READ PAT$
690 CALL CHAR(CHLL,PAT$)
700 NEXT CHLL
710 BGIR$="3C4426D999A5C3FF" !BAD girder for level HOLE creation
720 GIR$="FFC3A59999A5C3FF" !GIRDER FOR LEVELS
730 CALL CHAR(101,BGIR$,100,GIR$)!girder for level creation
740 GRAV$="FFFFFFFFFFFFFFFF" :: CALL CHAR(126,GRAV$)!THE HOLE
750 EXT$="FF9999BD999999FF" :: CALL CHAR(120,EXT$)!THE EXIT
760 HRT$="66FFFFFF7E7E3C18" :: CALL CHAR(80,HRT$)!THE HEART
770 ZED$="1818FFBD3C3C183C" :: CALL CHAR(88,ZED$)!THE ZED
780 MLE$="C0E0703A1E0C1A01" :: CALL CHAR(104,MLE$)!MELEE
790 RNG$="000000FF7F1E1606" :: CALL CHAR(112,RNG$)!RANGED WEAPONS
800 GOSUB 1980 !*******************************Create Level
810 REM******Create Sprite Idle********
820 CALL SPRITE(#1,CHRR,6,YP,XP)
830 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
840 IF JY=0 THEN 850 ELSE 2320
850 CALL COINC(ALL,C):: IF C=0 THEN 870 ELSE 860 !collision check
860 GOSUB 2180 !collision actions
870 IF S=0 THEN 1530 !no kb pressed check for joyst
880 REM ********jump routine check********
890 CALL MOTION(#1,0,0)
900 IF CS<>-16 THEN 940
910 CALL POSITION(#1,YP,XP)!get new position for next sprite
920 GOSUB 980 ! goto jump left
930 GOTO 810
940 IF CS<>16 THEN 1530
950 CALL POSITION(#1,YP,XP)!get new position for next sprite
960 GOSUB 1260 !goto jump right**************************
970 GOTO 810
980 REM *************jump left routine*********
990 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running!
1000 CALL SPRITE(#1,CHSL,6,YP,XP)!recreate sprite1 as stop and jump characters
1010 FOR PT=63 TO 67 !setup stop and jump animation
1020 CALL PATTERN(#1,PT)!ANIMATE
1030 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1040 NEXT DELAY
1050 NEXT PT !continue animating the stop and jump until done
1060 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping
1070 CS=-20 :: YP=YP-3
1080 CALL SPRITE(#1,CHJL,6,YP,XP,RS,CS)!recreat sprite 1 as jumping characters and put in to motion
1090 FOR PT=68 TO 71 !setup jumping characters left
1100 CALL PATTERN(#1,PT)
1110 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1120 NEXT DELAY
1130 NEXT PT
1140 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1150 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1160 YP=YP+3 !RESET YP TO BE GROUND.
1170 CALL SPRITE(#1,CHLL,6,YP,XP)
1180 FOR PT=72 TO 73 !setup landing animation left
1190 CALL PATTERN(#1,PT)
1200 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1210 NEXT DELAY
1220 NEXT PT ! continue landing animation until last frame
1230 CALL POSITION(#1,YP,XP)!get new position for next sprite
1240 CS=-16
1250 RETURN
1260 REM *************jump right routine******
1270 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running! right
1280 CALL SPRITE(#1,CHSR,6,YP,XP)!recreate sprite1 as stop and jump characters right
1290 FOR PT=46 TO 50 !setup stop and jump animation right
1300 CALL PATTERN(#1,PT)
1310 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1320 NEXT DELAY
1330 NEXT PT !continue animating the stop and jump until done right
1340 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping right
1350 CS=20 :: YP=YP-3 :: CALL SPRITE(#1,CHJR,6,YP,XP,RS,CS)!recreat sprite 1 as jumping characters and put in to motion right
1360 FOR PT=51 TO 54 !setup jumping characters right
1370 CALL PATTERN(#1,PT)
1380 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1390 NEXT DELAY
1400 NEXT PT
1410 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1420 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1430 YP=YP+3
1440 CALL SPRITE(#1,CHLR,6,YP,XP)
1450 FOR PT=56 TO 56 !setup landing animation
1460 CALL PATTERN(#1,PT)
1470 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1480 NEXT DELAY
1490 NEXT PT ! continue landing animation until last frame
1500 CALL POSITION(#1,YP,XP)!get new position for next sprite
1510 CS=16
1520 RETURN
1530 REM **************Check Joyst Options************
1540 IF JX<>0 THEN 1570
1550 CALL MOTION(#1,0,0)
1560 GOTO 830
1570 REM ********running check***************
1580 IF JX<>-4 THEN 1610
1590 CALL POSITION(#1,YP,XP)!get new position for next sprite
1600 GOSUB 1810
1610 IF JX<>4 THEN 830
1620 CALL POSITION(#1,YP,XP)!get new position for next sprite
1630 GOSUB 1650
1640 GOTO 830 !after RETURN goto joyst check
1650 REM ************run right routine********
1660 CS=16 :: CALL SPRITE(#1,CHRR,6,YP,XP)!create the runner and send running
1670 CALL MOTION(#1,0,JX*4)
1680 FOR PT=40 TO 45 !setup for animating the run
1690 CALL PATTERN(#1,PT)
1700 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
1710 CALL COINC(ALL,C):: IF C=0 THEN 1730 ELSE 1720 !collision check
1720 CALL MOTION(#1,0,0):: CALL POSITION(#1,YP,XP):: GOSUB 2180 !collision actions
1730 IF JX<>0 THEN 1750 ELSE 1740 !not joy pressed keep running
1740 CALL MOTION(#1,0,0):: RETURN
1750 IF JX=4 THEN 1770
1760 IF JX=-4 THEN 1800
1770 NEXT PT
1780 IF JX=4 THEN 1680
1790 CALL POSITION(#1,YP,XP)!check position and store before stopping motion
1800 RETURN
1810 REM **********run left routine**************
1820 CS=-16 :: CALL SPRITE(#1,CHRL,6,YP,XP)!create the runner and send running
1830 CALL MOTION(#1,0,JX*4)
1840 FOR PT=57 TO 62 !setup for animating the run
1850 CALL PATTERN(#1,PT)
1860 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
1870 CALL COINC(ALL,C):: IF C=0 THEN 1890 ELSE 1880 !collision check
1880 CALL MOTION(#1,0,0):: CALL POSITION(#1,YP,XP):: GOSUB 2180 !collision actions
1890 IF JY=0 THEN 1900 ELSE 2320
1900 IF JX<>0 THEN 1920 ELSE 1910 !not joy pressed keep running
1910 CALL MOTION(#1,0,0):: RETURN
1920 IF JX=-4 THEN 1940
1930 IF JX=4 THEN 1970
1940 NEXT PT
1950 IF JX=-4 THEN 1830
1960 CALL POSITION(#1,YP,XP)!check position and store for next sprite
1970 RETURN
1980 REM ******************level creation************************
1990 HLE=INT((RND*15)+5)
2000 FOR LVL=1 TO 7
2010 IF LVL=1 THEN 2030
2020 GOSUB 2360 !******LOOT**********
2030 CALL VCHAR(1,1,100,24)!LEFT WALL
2040 CALL VCHAR(1,28,100,24)!RIGHT WALL
2050 CALL HCHAR(LVL*3,1,100,HLE-1)!LEFT SIDE GIRDERS
2060 CALL SPRITE(#SHL,126,1,GRND-3,(HLE*+1)!HOLE PROPER
2070 CALL HCHAR(LVL*3,HLE+3,100,28-(HLE+3))!CRUMBLE RIGHT SIDE
2080 CALL HCHAR(LVL*3,HLE,101)!CRUMBLE LEFT SIDE
2090 CALL HCHAR(LVL*3,HLE+2,101)!RIGHT SIDE GIRDERS
2100 GRND=GRND+24 :: HOL=INT((RND*15)+5)!NEW LOCATION FOR HOLE
2110 IF HOL=HLE THEN 2100 !NOT EQUAL TO PREVIOUS HOLE
2120 HLE=HOL !SET PROPER HOLE VARIABLE
2130 SHL=SHL+1 !ADVANCE SPRITE #
2140 NEXT LVL !GO CREATE NEXT LEVEL
2150 CALL SPRITE(#10,120,15,22*8,26*! THE EXIT
2160 CALL HCHAR(24,1,100,28)!THE FLOOR
2170 RETURN
2180 REM *************collision action*******
2190 CALL COINC(#1,#10,4,C):: IF C<>0 THEN 2320 ELSE 2200 !collision check against exit
2200 FOR DET=2 TO 8
2210 CALL COINC(#1,#DET,6,C)!collision check against holes
2220 IF C<>0 THEN 2300 ELSE 2230
2230 NEXT DET
2240 FOR DET=10 TO SLOT
2250 CALL COINC(#1,#DET,6,C)!collision check against LOOT
2260 IF C<>0 THEN 2270 ELSE 2280
2270 CALL DELSPRITE(#DET):: GOTO 2310 !TEMP CODE - NEED TO GET PATTERNS TO IDENTIFY LOOT BEFORE BEHAVIOUR
2280 NEXT DET
2290 GOTO 2310
2300 FOR FALL=1 TO 24 :: YP=YP+1 :: CALL SPRITE(#1,CHRR,6,YP,XP):: NEXT FALL
2310 RETURN
2320 REM ***********DEMO RESET*************
2330 CALL DELSPRITE(ALL)
2340 RESTORE 220
2350 GOTO 140
2360 REM *********LOOT DISTRIBUTION SYSTEM******
2370 SWITCH=INT(RND*2)+1
2380 FOR LT=1 TO 2
2390 LOOT=INT(RND*4)+1
2400 IF SWITCH=1 THEN SWITCH=-5
2410 IF SWITCH=2 THEN SWITCH=5
2420 IF SWITCH=5 THEN SWITCH=-5 ELSE SWITCH=5
2430 IF LOOT<>1 THEN 2510
2440 CALL SPRITE(#SLOT,80,7,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !HEART LOOT
2450 TP1=((HLE+1)*+SWITCH*8
2460 LO0T(LAB,LTN)=TP1 :: LAB=LAB+1
2470 LO0T(LAB,LTN)=(GRND-9):: LAB=LAB+1
2480 LO0T(LAB,LTN)=80 :: LAB=LAB+1
2490 LO0T(LAB,LTN)=100 :: LAB=LAB+1
2500 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
2510 IF LOOT<>2 THEN 2590
2520 CALL SPRITE(#SLOT,88,4,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !ZED
2530 TP1=((HLE+1)*+SWITCH*8
2540 LO0T(LAB,LTN)=TP1 :: LAB=LAB+1
2550 LO0T(LAB,LTN)=(GRND-9):: LAB=LAB+1
2560 LO0T(LAB,LTN)=88 :: LAB=LAB+1
2570 LO0T(LAB,LTN)=75 :: LAB=LAB+1
2580 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
2590 IF LOOT<>3 THEN 2670
2600 CALL SPRITE(#SLOT,104,8,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !MELEE
2610 TP1=((HLE+1)*+SWITCH*8
2620 LO0T(LAB,LTN)=TP1 :: LAB=LAB+1
2630 LO0T(LAB,LTN)=(GRND-9):: LAB=LAB+1
2640 LO0T(LAB,LTN)=104 :: LAB=LAB+1
2650 LO0T(LAB,LTN)=25 :: LAB=LAB+1
2660 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
2670 IF LOOT<>4 THEN 2750
2680 CALL SPRITE(#SLOT,112,14,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !RANGED
2690 TP1=((HLE+1)*+SWITCH*8
2700 LO0T(LAB,LTN)=TP1 :: LAB=LAB+1
2710 LO0T(LAB,LTN)=(GRND-9):: LAB=LAB+1
2720 LO0T(LAB,LTN)=112 :: LAB=LAB+1
2730 LO0T(LAB,LTN)=50 :: LAB=LAB+1
2740 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
2750 NEXT LT
2760 RETURN

I'm collecting row coord, col coord, char code, points and sprite number
Edited by Sinphaltimus
Link to comment
Share on other sites

Note to self...DISPLAY AT ***BEFORE*** CALL VCHAR !!!!
It took me way too long and too much debugging before I figured that one out. Never even knew it was a thing. Just by chance thought I'd give it a try.

Yeah.. Anyway, now that I'm done talking to myself out load in text on a forum. Here's my latest advancement.

I have the infrastructure in place for score, health and inventory.

It's buggy and laggy. I'm not optimizing for a bit yet. I still have other things I need to code in before I start trimming code, optimizing tasks and fixing issues.

What I have to do in the short term is get Zombies moving with basic AI, figure out increasing difficulty per board (level), figure out board(level) advancement, combat system and damage.

For now, I have the GUI in place and working.

 

 

 

 
100 OPTION BASE 1
110 DIM LO0T(5,14)
120 LTN=1 !LOOT ARRAY COORDS COL
130 LAB=1 !LOOT ARRAY COORDS ROW
140 CALL CLEAR
150 CALL SCREEN(2)
160 RANDOMIZE
170 CALL COLOR(10,15,1):: CALL COLOR(12,12,1):: CALL COLOR(3,12,1):: CALL COLOR(4,12,1)
180 CALL COLOR(8,7,1):: CALL COLOR(11,8,1)
190 YP=9 :: XP=15 :: RS=0 :: CS=16 !start position direction and velocity
200 SLOT=11 !STARTING SPRITE NUMBER FOR LOOT
210 GRND=17 :: LVL=3 :: SHL=2 :: SCORE=0000 :: HEALTH=10 !START ground level on top girder (YP+8pixels), LEVEL AND SPRITE HOLE #
220 !running patterns right
230 MELEE=0 :: RANGED=0 !weapons inventory
240 DATA 1818101010101018,1818183C1C142630,181A3C5E1A334060,18197E981C724100,18197E9818147243,1818385E581C2436
250 !stop and jump right
260 DATA 1818101010101018,000C1C3058081018,00000C1C305C1C18,0000060E183C0C18,0003070C18081018
270 !jumping right
280 DATA 0303040609081010,1818141810106000,1818103810180C00,1818503010180404
290 !landing right
300 DATA 0018183050180818,1818101038501018
310 !running patterns left
320 DATA 1818080808080818,1818183C3828640C,18583C7A58CC0206,18987E19384E8200,18987E1918284EC2,18181C7A1A38246C
330 !stop and jump left
340 DATA 1818080808080818,0030380C1A100818,000030380C3A3818,00006070183C3018,00C0E03018100818
350 !jumping left
360 DATA C0C0206090100808,1818281808080600,1818081C08183000,18180A0C08182020
370 !landing right
380 DATA 0018180C0A181018,181808081C0A0818
390 FOR CHRR=33 TO 38 !setup for creating running characters right
400 READ PAT$
410 CALL CHAR(CHRR,PAT$)
420 NEXT CHRR
430 REM CHR=CHRR
440 FOR CHSR=39 TO 43 !setup for creating stop and jump characters right
450 READ PAT$
460 CALL CHAR(CHSR,PAT$)
470 NEXT CHSR
480 FOR CHJR=64 TO 67 !setup for creating jumping characters right
490 READ PAT$
500 CALL CHAR(CHJR,PAT$)
510 NEXT CHJR
520 FOR CHLR=68 TO 69 !setup for creating landing characters right
530 READ PAT$
540 CALL CHAR(CHLR,PAT$)
550 NEXT CHLR
560 REM left running***********************
570 FOR CHRL=70 TO 75 !setup for creating running characters left
580 READ PAT$
590 CALL CHAR(CHRL,PAT$)
600 NEXT CHRL
610 FOR CHSL=76 TO 80 !setup for creating stop and jump characters left
620 READ PAT$
630 CALL CHAR(CHSL,PAT$)
640 NEXT CHSL
650 FOR CHJL=81 TO 84 !setup for creating jumping characters left
660 READ PAT$
670 CALL CHAR(CHJL,PAT$)
680 NEXT CHJL
690 FOR CHLL=85 TO 86 !setup for creating landing characters left
700 READ PAT$
710 CALL CHAR(CHLL,PAT$)
720 NEXT CHLL
730 BGIR$="3C4426D999A5C3FF" !BAD girder for level HOLE creation
740 GIR$="FFC3A59999A5C3FF" !GIRDER FOR LEVELS
750 CALL CHAR(104,BGIR$,105,GIR$)!girder for level creation
760 GRAV$="FFFFFFFFFFFFFFFF" :: CALL CHAR(106,GRAV$)!THE HOLE
770 EXT$="FF9999BD999999FF" :: CALL CHAR(107,EXT$)!THE EXIT
780 HRT$="66FFFFFF7E7E3C18" :: CALL CHAR(88,HRT$)!THE HEART
790 ZED$="1818FFBD3C3C183C" :: CALL CHAR(96,ZED$)!THE ZED
800 MLE$="C0E0703A1E0C1A01" :: CALL CHAR(112,MLE$)!MELEE
810 RNG$="000000FF7F1E1606" :: CALL CHAR(113,RNG$)!RANGED WEAPONS
820 SCTXT1$="70808063141414E3" :: SCTXT2$="00000000334A4A32" :: SCTXT3$="00000000993C2118"
830 CALL CHAR(120,SCTXT1$):: CALL CHAR(121,SCTXT2$):: CALL CHAR(122,SCTXT3$)
840 EXTXT$="0044442810284444" :: CALL CHAR(123,EXTXT$)
850 GOSUB 2030 !*******************************Create Level
860 REM******Create Sprite Idle********
870 CALL SPRITE(#1,CHRR,6,YP,XP)
880 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
890 IF JY=0 THEN 900 ELSE 2710
900 CALL COINC(ALL,C):: IF C=0 THEN 920 ELSE 910 !collision check
910 GOSUB 2270 !collision actions
920 IF S=0 THEN 1580 !no kb pressed check for joyst
930 REM ********jump routine check********
940 CALL MOTION(#1,0,0)
950 IF CS<>-16 THEN 990
960 CALL POSITION(#1,YP,XP)!get new position for next sprite
970 GOSUB 1030 ! goto jump left
980 GOTO 860
990 IF CS<>16 THEN 1580
1000 CALL POSITION(#1,YP,XP)!get new position for next sprite
1010 GOSUB 1310 !goto jump right**************************
1020 GOTO 860
1030 REM *************jump left routine*********
1040 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running!
1050 CALL SPRITE(#1,CHSL,6,YP,XP)!recreate sprite1 as stop and jump characters
1060 FOR PT=76 TO 80 !setup stop and jump animation left
1070 CALL PATTERN(#1,PT)!ANIMATE
1080 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1090 NEXT DELAY
1100 NEXT PT !continue animating the stop and jump until done
1110 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping
1120 CS=-20 :: YP=YP-3
1130 CALL SPRITE(#1,CHJL,6,YP,XP,RS,CS)!recreat sprite 1 as jumping characters and put in to motion
1140 FOR PT=81 TO 84 !setup jumping characters left
1150 CALL PATTERN(#1,PT)
1160 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1170 NEXT DELAY
1180 NEXT PT
1190 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1200 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1210 YP=YP+3 !RESET YP TO BE GROUND.
1220 CALL SPRITE(#1,CHLL,6,YP,XP)
1230 FOR PT=85 TO 86 !setup landing animation left
1240 CALL PATTERN(#1,PT)
1250 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1260 NEXT DELAY
1270 NEXT PT ! continue landing animation until last frame
1280 CALL POSITION(#1,YP,XP)!get new position for next sprite
1290 CS=-16
1300 RETURN
1310 REM *************jump right routine******
1320 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running! right
1330 CALL SPRITE(#1,CHSR,6,YP,XP)!recreate sprite1 as stop and jump characters right
1340 FOR PT=39 TO 43 !setup stop and jump animation right
1350 CALL PATTERN(#1,PT)
1360 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1370 NEXT DELAY
1380 NEXT PT !continue animating the stop and jump until done right
1390 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping right
1400 CS=20 :: YP=YP-3 :: CALL SPRITE(#1,CHJR,6,YP,XP,RS,CS)!recreat sprite 1 as jumping characters and put in to motion right
1410 FOR PT=64 TO 67 !setup jumping characters right
1420 CALL PATTERN(#1,PT)
1430 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1440 NEXT DELAY
1450 NEXT PT
1460 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1470 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1480 YP=YP+3
1490 CALL SPRITE(#1,CHLR,6,YP,XP)
1500 FOR PT=68 TO 69 !setup landing animation
1510 CALL PATTERN(#1,PT)
1520 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1530 NEXT DELAY
1540 NEXT PT ! continue landing animation until last frame
1550 CALL POSITION(#1,YP,XP)!get new position for next sprite
1560 CS=16
1570 RETURN
1580 REM **************Check Joyst Options************
1590 IF JX<>0 THEN 1620
1600 CALL MOTION(#1,0,0)
1610 GOTO 880
1620 REM ********running check***************
1630 IF JX<>-4 THEN 1660
1640 CALL POSITION(#1,YP,XP)!get new position for next sprite
1650 GOSUB 1860
1660 IF JX<>4 THEN 880
1670 CALL POSITION(#1,YP,XP)!get new position for next sprite
1680 GOSUB 1700
1690 GOTO 880 !after RETURN goto joyst check
1700 REM ************run right routine********
1710 CS=16 :: CALL SPRITE(#1,CHRR,6,YP,XP)!create the runner and send running
1720 CALL MOTION(#1,0,JX*4)
1730 FOR PT=33 TO 38 !setup for animating the run
1740 CALL PATTERN(#1,PT)
1750 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
1760 CALL COINC(ALL,C):: IF C=0 THEN 1780 ELSE 1770 !collision check
1770 CALL MOTION(#1,0,0):: CALL POSITION(#1,YP,XP):: GOSUB 2270 !collision actions
1780 IF JX<>0 THEN 1800 ELSE 1790 !not joy pressed keep running
1790 CALL MOTION(#1,0,0):: RETURN
1800 IF JX=4 THEN 1820
1810 IF JX=-4 THEN 1850
1820 NEXT PT
1830 IF JX=4 THEN 1730
1840 CALL POSITION(#1,YP,XP)!check position and store before stopping motion
1850 RETURN
1860 REM **********run left routine**************
1870 CS=-16 :: CALL SPRITE(#1,CHRL,6,YP,XP)!create the runner and send running
1880 CALL MOTION(#1,0,JX*4)
1890 FOR PT=70 TO 75 !setup for animating the run
1900 CALL PATTERN(#1,PT)
1910 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
1920 CALL COINC(ALL,C):: IF C=0 THEN 1940 ELSE 1930 !collision check
1930 CALL MOTION(#1,0,0):: CALL POSITION(#1,YP,XP):: GOSUB 2270 !collision actions
1940 IF JY=0 THEN 1950 ELSE 2710
1950 IF JX<>0 THEN 1970 ELSE 1960 !not joy pressed keep running
1960 CALL MOTION(#1,0,0):: RETURN
1970 IF JX=-4 THEN 1990
1980 IF JX=4 THEN 2020
1990 NEXT PT
2000 IF JX=-4 THEN 1880
2010 CALL POSITION(#1,YP,XP)!check position and store for next sprite
2020 RETURN
2030 REM ******************level creation************************
2040 DISPLAY AT(1,3):SCORE :: DISPLAY AT(1,11):HEALTH :: DISPLAY AT(1,16):MELEE :: DISPLAY AT(1,21):RANGED
2050 CALL VCHAR(1,2,120):: CALL VCHAR(1,3,121):: CALL VCHAR(1,4,122)!score text gui
2060 CALL VCHAR(1,13,123):: CALL VCHAR(1,18,123):: CALL VCHAR(1,23,123)!Xs gui
2070 CALL VCHAR(1,12,88):: CALL VCHAR(1,17,112):: CALL VCHAR(1,22,113)!hearts,melee,ranged gui
2080 HLE=INT((RND*15)+5)
2090 FOR LVL=1 TO 7
2100 IF LVL=1 THEN 2120
2110 GOSUB 2750 !******LOOT**********
2120 CALL VCHAR(1,1,105,24)!LEFT WALL
2130 CALL VCHAR(1,28,105,24)!RIGHT WALL
2140 CALL HCHAR(LVL*3,1,105,HLE-1)!LEFT SIDE GIRDERS
2150 CALL SPRITE(#SHL,106,1,GRND-3,(HLE*+1)!HOLE PROPER
2160 CALL HCHAR(LVL*3,HLE+3,105,28-(HLE+3))!RIGHT SIDE Girders
2170 CALL HCHAR(LVL*3,HLE,104)!CRUMBLE LEFT SIDE
2180 CALL HCHAR(LVL*3,HLE+2,104)!crumble right side
2190 GRND=GRND+24 :: HOL=INT((RND*15)+5)!NEW LOCATION FOR HOLE
2200 IF HOL=HLE THEN 2190 !NOT EQUAL TO PREVIOUS HOLE
2210 HLE=HOL !SET PROPER HOLE VARIABLE
2220 SHL=SHL+1 !ADVANCE SPRITE #
2230 NEXT LVL !GO CREATE NEXT LEVEL
2240 CALL SPRITE(#10,107,15,22*8,26*! THE EXIT
2250 CALL HCHAR(24,1,105,28)!THE FLOOR
2260 RETURN
2270 REM *************collision action*******
2280 CALL COINC(#1,#10,4,C):: IF C<>0 THEN 2710 ELSE 2290 !*********collision check against exit
2290 FOR DET=2 TO 8
2300 CALL COINC(#1,#DET,6,C)!*************************************collision check against holes
2310 IF C<>0 THEN 2690 ELSE 2320
2320 NEXT DET
2330 FOR DET=10 TO SLOT !************************collision check against LOOT*********************
2340 CALL COINC(#1,#DET,6,C)
2350 IF C<>0 THEN 2360 ELSE 2670
2360 FOR TLOOP1=1 TO 14
2370 IF LO0T(5,TLOOP1)<>DET THEN 2380 ELSE 2390
2380 NEXT TLOOP1
2390 IF LO0T(3,TLOOP1)<>88 THEN 2460 !heart
2400 SCORE=SCORE+100 :: IF HEALTH<10 THEN HEALTH=HEALTH+1
2410 DISPLAY AT(1,3):SCORE :: DISPLAY AT(1,11):HEALTH :: DISPLAY AT(1,16):MELEE :: DISPLAY AT(1,21):RANGED
2420 CALL VCHAR(1,2,120):: CALL VCHAR(1,3,121):: CALL VCHAR(1,4,122)!score text gui
2430 CALL VCHAR(1,13,123):: CALL VCHAR(1,18,123):: CALL VCHAR(1,23,123)!Xs gui
2440 CALL VCHAR(1,12,88):: CALL VCHAR(1,17,112):: CALL VCHAR(1,22,113)!hearts,melee,ranged gui
2450 GOTO 2660
2460 IF LO0T(3,TLOOP1)<>96 THEN 2530 !zed
2470 SCORE=SCORE+75 ::
2480 DISPLAY AT(1,3):SCORE :: DISPLAY AT(1,11):HEALTH :: DISPLAY AT(1,16):MELEE :: DISPLAY AT(1,21):RANGED
2490 CALL VCHAR(1,2,120):: CALL VCHAR(1,3,121):: CALL VCHAR(1,4,122)!score text gui
2500 CALL VCHAR(1,13,123):: CALL VCHAR(1,18,123):: CALL VCHAR(1,23,123)!Xs gui
2510 CALL VCHAR(1,12,88):: CALL VCHAR(1,17,112):: CALL VCHAR(1,22,113)!hearts,melee,ranged gui
2520 GOTO 2660
2530 IF LO0T(3,TLOOP1)<>112 THEN 2600 !melee
2540 SCORE=SCORE+25 :: MELEE=MELEE+1
2550 DISPLAY AT(1,3):SCORE :: DISPLAY AT(1,11):HEALTH :: DISPLAY AT(1,16):MELEE :: DISPLAY AT(1,21):RANGED
2560 CALL VCHAR(1,2,120):: CALL VCHAR(1,3,121):: CALL VCHAR(1,4,122)!score text gui
2570 CALL VCHAR(1,13,123):: CALL VCHAR(1,18,123):: CALL VCHAR(1,23,123)!Xs gui
2580 CALL VCHAR(1,12,88):: CALL VCHAR(1,17,112):: CALL VCHAR(1,22,113)!hearts,melee,ranged gui
2590 GOTO 2660
2600 IF LO0T(3,TLOOP1)<>113 THEN 2660 !ranged
2610 SCORE=SCORE+50 :: RANGED=RANGED+1
2620 DISPLAY AT(1,3):SCORE :: DISPLAY AT(1,11):HEALTH :: DISPLAY AT(1,16):MELEE :: DISPLAY AT(1,21):RANGED
2630 CALL VCHAR(1,2,120):: CALL VCHAR(1,3,121):: CALL VCHAR(1,4,122)!score text gui
2640 CALL VCHAR(1,13,123):: CALL VCHAR(1,18,123):: CALL VCHAR(1,23,123)!Xs gui
2650 CALL VCHAR(1,12,88):: CALL VCHAR(1,17,112):: CALL VCHAR(1,22,113)!hearts,melee,ranged gui
2660 CALL DELSPRITE(#DET):: GOTO 2700 !TEMP CODE - NEED TO GET PATTERNS TO IDENTIFY LOOT BEFORE BEHAVIOUR
2670 NEXT DET
2680 GOTO 2700
2690 FOR FALL=1 TO 24 :: YP=YP+1 :: CALL SPRITE(#1,CHRR,6,YP,XP):: NEXT FALL !*****FALL**********
2700 RETURN
2710 REM ***********DEMO RESET*************
2720 CALL DELSPRITE(ALL)
2730 RESTORE 240
2740 GOTO 100
2750 REM *********LOOT DISTRIBUTION SYSTEM******
2760 SWITCH=INT(RND*2)+1
2770 FOR LT=1 TO 2
2780 LOOT=INT(RND*4)+1
2790 IF SWITCH=1 THEN SWITCH=-5
2800 IF SWITCH=2 THEN SWITCH=5
2810 IF SWITCH=5 THEN SWITCH=-5 ELSE SWITCH=5
2820 IF LOOT<>1 THEN 2900
2830 CALL SPRITE(#SLOT,88,7,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !HEART LOOT
2840 TP1=((HLE+1)*+SWITCH*8
2850 LO0T(LAB,LTN)=TP1 :: LAB=LAB+1
2860 LO0T(LAB,LTN)=(GRND-9):: LAB=LAB+1
2870 LO0T(LAB,LTN)=88 :: LAB=LAB+1
2880 LO0T(LAB,LTN)=100 :: LAB=LAB+1
2890 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
2900 IF LOOT<>2 THEN 2980
2910 CALL SPRITE(#SLOT,96,4,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !ZED
2920 TP1=((HLE+1)*+SWITCH*8
2930 LO0T(LAB,LTN)=TP1 :: LAB=LAB+1
2940 LO0T(LAB,LTN)=(GRND-9):: LAB=LAB+1
2950 LO0T(LAB,LTN)=96 :: LAB=LAB+1
2960 LO0T(LAB,LTN)=75 :: LAB=LAB+1
2970 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
2980 IF LOOT<>3 THEN 3060
2990 CALL SPRITE(#SLOT,112,8,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !MELEE
3000 TP1=((HLE+1)*+SWITCH*8
3010 LO0T(LAB,LTN)=TP1 :: LAB=LAB+1
3020 LO0T(LAB,LTN)=(GRND-9):: LAB=LAB+1
3030 LO0T(LAB,LTN)=112 :: LAB=LAB+1
3040 LO0T(LAB,LTN)=25 :: LAB=LAB+1
3050 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
3060 IF LOOT<>4 THEN 3140
3070 CALL SPRITE(#SLOT,113,14,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !RANGED
3080 TP1=((HLE+1)*+SWITCH*8
3090 LO0T(LAB,LTN)=TP1 :: LAB=LAB+1
3100 LO0T(LAB,LTN)=(GRND-9):: LAB=LAB+1
3110 LO0T(LAB,LTN)=113 :: LAB=LAB+1
3120 LO0T(LAB,LTN)=50 :: LAB=LAB+1
3130 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
3140 NEXT LT
3150 RETURN
 

 

 

 

 

13903217_10206743175409978_2795315063907

Edited by Sinphaltimus
  • Like 1
Link to comment
Share on other sites

13882613_10206747180590105_7544198560067

 

This latest version 0.22-081516

Includes the final design layout (with the exception of the Board (level) indicator).
Player can no longer wrap around the screen (proper girder borders set).

Player no longer gets stuck running in position after a fall or collecting loot while holding joystick left or right during the action.

Tweaked some graphics and animations,

Known Issues:
Sometimes holes don't spawn where holes are supposed to spawn causing a "no exit" situation. I dunno why yet.
Sometimes loot doesn't spawn where it is supposed to. I dunno why yet.

Sometimes the player falls through the girders near or very far from the hole. I dunno why yet.

To Do Next:
Figure out board progression and indicator.
Reorganize code so default variable declarations are outside of any level progression.
Create attacks for melee and ranged including inventory changes

Create basic zombie AI and animate.

To Do Long Term:

Title screen.

Sounds

Music maybe? - can I play music while player plays game efficiently?

Loot balancing with board progression.

zombie difficulty linked to board progression.

At least 2 more types of ever more difficult zombies.

 

 

 

100 OPTION BASE 1
110 DIM LO0T(2,14)
120 LTN=1 !LOOT ARRAY COORDS COL
130 LAB=1 !LOOT ARRAY COORDS ROW
140 CALL CLEAR
150 CALL SCREEN(2)
160 RANDOMIZE
170 CALL COLOR(10,15,1):: CALL COLOR(12,12,1):: CALL COLOR(3,12,1):: CALL COLOR(4,12,1)
180 CALL COLOR(8,7,1):: CALL COLOR(11,8,1)
190 YP=9 :: XP=8 :: RS=0 :: CS=16 :: RSPD=2 !start position direction and velocity
200 SLOT=11 !STARTING SPRITE NUMBER FOR LOOT
210 GRND=17 :: LVL=3 :: SHL=2 :: SCORE=0000 :: HEALTH=10 !START ground level on top girder (YP+8pixels), LEVEL AND SPRITE HOLE #
220 !running patterns right
230 MELEE=0 :: RANGED=0 !weapons inventory
240 DATA 1818101010101018,1818183C1C142630,181A3C5E1A334060,18197E981C724100,18197E9818147243,1818385E581C2436
250 !stop and jump right
260 DATA 1818101010101018,000C1C3058081018,00000C1C305C1C18,0000060E183C0C18,0003070C18081018
270 !jumping right
280 DATA 0303040609081010,1818141810106000,1818103810180C00,1818503010180404
290 !landing right
300 DATA 0018183050180818,1818101038501018
310 !running patterns left
320 DATA 1818080808080818,1818183C3828640C,18583C7A58CC0206,18987E19384E8200,18987E1918284EC2,18181C7A1A38246C
330 !stop and jump left
340 DATA 1818080808080818,0030380C1A100818,000030380C3A3818,00006070183C3018,00C0E03018100818
350 !jumping left
360 DATA C0C0206090100808,1818281808080600,1818081C08183000,18180A0C08182020
370 !landing right
380 DATA 0018180C0A181018,181808081C0A0818
390 FOR CHRR=33 TO 38 !setup for creating running characters right
400 READ PAT$
410 CALL CHAR(CHRR,PAT$)
420 NEXT CHRR
430 REM CHR=CHRR
440 FOR CHSR=39 TO 43 !setup for creating stop and jump characters right
450 READ PAT$
460 CALL CHAR(CHSR,PAT$)
470 NEXT CHSR
480 FOR CHJR=64 TO 67 !setup for creating jumping characters right
490 READ PAT$
500 CALL CHAR(CHJR,PAT$)
510 NEXT CHJR
520 FOR CHLR=68 TO 69 !setup for creating landing characters right
530 READ PAT$
540 CALL CHAR(CHLR,PAT$)
550 NEXT CHLR
560 REM left running***********************
570 FOR CHRL=70 TO 75 !setup for creating running characters left
580 READ PAT$
590 CALL CHAR(CHRL,PAT$)
600 NEXT CHRL
610 FOR CHSL=76 TO 80 !setup for creating stop and jump characters left
620 READ PAT$
630 CALL CHAR(CHSL,PAT$)
640 NEXT CHSL
650 FOR CHJL=81 TO 84 !setup for creating jumping characters left
660 READ PAT$
670 CALL CHAR(CHJL,PAT$)
680 NEXT CHJL
690 FOR CHLL=85 TO 86 !setup for creating landing characters left
700 READ PAT$
710 CALL CHAR(CHLL,PAT$)
720 NEXT CHLL
730 BGIR$="3C4426D999A5C3FF" !BAD girder for level HOLE creation
740 GIR$="FFC3A59999A5C3FF" !GIRDER FOR LEVELS
750 CALL CHAR(104,BGIR$,105,GIR$)!girder for level creation
760 GRAV$="FFFFFFFFFFFFFFFF" :: CALL CHAR(106,GRAV$)!THE HOLE
770 EXT$="1F1111111D11111F" :: CALL CHAR(107,EXT$)!THE EXIT
780 HRT$="66FFFFFF7E7E3C18" :: CALL CHAR(88,HRT$)!THE HEART
790 ZED$="3C2418FF9918183C" :: CALL CHAR(96,ZED$)!THE ZED
800 MLE$="C0E0703A1E0C1A01" :: CALL CHAR(112,MLE$)!MELEE
810 RNG$="000000FF7F1E1606" :: CALL CHAR(113,RNG$)!RANGED WEAPONS
820 SCTXT1$="70808063141414E3" :: SCTXT2$="00000000334A4A32" :: SCTXT3$="00000000993C2118" !Word Score
830 CALL CHAR(120,SCTXT1$):: CALL CHAR(121,SCTXT2$):: CALL CHAR(122,SCTXT3$)
840 EXTXT$="0044442810284444" :: CALL CHAR(123,EXTXT$)! the letter X remain for GUI
850 IDLE$="3838107CBA38286C" :: CALL CHAR(44,IDLE$)!***IDLE MAN
860 GOSUB 2120 !*******************************Create Level
870 REM***************************************Create Sprite Idle********
880 CALL SPRITE(#1,44,6,YP,XP)
890 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
900 IF JY=0 THEN 910 ELSE 2800
910 CALL COINC(ALL,C):: IF C=0 THEN 930 ELSE 920 !collision check
920 GOSUB 2360 !collision actions
930 GOSUB 3110 !*************WALL COLLISION CHECK
940 IF S=0 THEN 1610 !no kb pressed check for joyst
950 REM ********jump routine check********
960 CALL MOTION(#1,0,0)
970 IF CS<>-16 THEN 1010
980 CALL POSITION(#1,YP,XP)!get new position for next sprite
990 GOSUB 1050 ! goto jump left
1000 GOTO 870
1010 IF CS<>16 THEN 1610
1020 CALL POSITION(#1,YP,XP)!get new position for next sprite
1030 GOSUB 1330 !goto jump right**************************
1040 GOTO 870
1050 REM *************jump left routine*********
1060 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running!
1070 CALL SPRITE(#1,CHSL,6,YP,XP)!recreate sprite1 as stop and jump characters
1080 FOR PT=76 TO 80 !setup stop and jump animation left
1090 CALL PATTERN(#1,PT)!ANIMATE
1100 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1110 NEXT DELAY
1120 NEXT PT !continue animating the stop and jump until done
1130 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping
1140 IF XP<=24 THEN 1240
1150 CS=-20 :: YP=YP-3 :: RS=0 :: CALL SPRITE(#1,CHJL,6,YP,XP,RS,CS)!jumping left
1160 FOR PT=81 TO 84
1170 CALL PATTERN(#1,PT)
1180 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1190 NEXT DELAY
1200 NEXT PT
1210 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1220 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1230 YP=YP+3 !RESET YP TO BE GROUND.
1240 CALL SPRITE(#1,CHLL,6,YP,XP)
1250 FOR PT=85 TO 86 !setup landing animation left
1260 CALL PATTERN(#1,PT)
1270 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1280 NEXT DELAY
1290 NEXT PT ! continue landing animation until last frame
1300 CALL POSITION(#1,YP,XP)!get new position for next sprite
1310 CS=-16
1320 RETURN
1330 REM *************jump right routine******
1340 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running! right
1350 CALL SPRITE(#1,CHSR,6,YP,XP)!recreate sprite1 as stop and jump characters right
1360 FOR PT=39 TO 43 !setup stop and jump animation right
1370 CALL PATTERN(#1,PT)
1380 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1390 NEXT DELAY
1400 NEXT PT !continue animating the stop and jump until done right
1410 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping right
1420 IF XP>=224 THEN 1520
1430 CS=20 :: YP=YP-3 :: CALL SPRITE(#1,CHJR,6,YP,XP,RS,CS)!jumping right
1440 FOR PT=64 TO 67 !setup jumping characters right
1450 CALL PATTERN(#1,PT)
1460 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1470 NEXT DELAY
1480 NEXT PT
1490 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1500 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1510 YP=YP+3
1520 CALL SPRITE(#1,CHLR,6,YP,XP)
1530 FOR PT=68 TO 69 !setup landing animation
1540 CALL PATTERN(#1,PT)
1550 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1560 NEXT DELAY
1570 NEXT PT ! continue landing animation until last frame
1580 CALL POSITION(#1,YP,XP)!get new position for next sprite
1590 CS=16
1600 RETURN
1610 REM **************Check Joyst Options************
1620 IF JX<>0 THEN 1650
1630 CALL MOTION(#1,0,0)
1640 GOTO 890
1650 REM ********running check***************
1660 IF JX<>-4 THEN 1690
1670 CALL POSITION(#1,YP,XP)!get new position for next sprite
1680 GOSUB 1920
1690 IF JX<>4 THEN 890
1700 CALL POSITION(#1,YP,XP)!get new position for next sprite
1710 GOSUB 1730
1720 GOTO 890 !after RETURN goto joyst check
1730 REM ************run right routine********
1740 CS=16 :: CALL SPRITE(#1,CHRR,6,YP,XP)!create the runner and send running
1750 CALL MOTION(#1,0,JX*RSPD)
1760 FOR PT=33 TO 38 !setup for animating the run right
1770 CALL PATTERN(#1,PT)
1780 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
1790 CALL COINC(ALL,C):: IF C=0 THEN 1810 ELSE 1800 !collision check
1800 CALL MOTION(#1,0,0):: CALL POSITION(#1,YP,XP):: GOSUB 2360 !collision actions
1810 GOSUB 3110 !*************WALL COLLISION CHECK
1820 IF JY=0 THEN 1830 ELSE 2800
1830 IF JX<>0 THEN 1850 ELSE 1840 !not joy pressed keep running
1840 CALL POSITION(#1,YP,XP):: CALL MOTION(#1,0,0):: CALL SPRITE(#1,44,6,YP,XP):: RETURN
1850 IF JX=4 THEN 1870
1860 IF JX=-4 THEN 1910
1870 CALL MOTION(#1,0,JX*RSPD)
1880 NEXT PT
1890 IF JX=4 THEN 1760
1900 CALL POSITION(#1,YP,XP)!check position and store before stopping motion
1910 RETURN
1920 REM **********run left routine**************
1930 CS=-16 :: CALL SPRITE(#1,CHRL,6,YP,XP)!create the runner and send running
1940 CALL MOTION(#1,0,JX*RSPD)
1950 FOR PT=70 TO 75 !setup for animating the run left
1960 CALL PATTERN(#1,PT)
1970 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
1980 CALL COINC(ALL,C):: IF C=0 THEN 2000 ELSE 1990 !collision check
1990 CALL MOTION(#1,0,0):: CALL POSITION(#1,YP,XP):: GOSUB 2360 !collision actions
2000 GOSUB 3110 !*************WALL COLLISION CHECK
2010 IF JY=0 THEN 2020 ELSE 2800
2020 IF JX<>0 THEN 2040 ELSE 2030 !not joy pressed keep running
2030 CALL POSITION(#1,YP,XP):: CALL MOTION(#1,0,0):: CALL SPRITE(#1,44,6,YP,XP):: RETURN
2040 CALL JOYST(1,JX,JY)
2050 IF JX=-4 THEN 2070
2060 IF JX=4 THEN 2110
2070 CALL MOTION(#1,0,JX*RSPD)
2080 NEXT PT
2090 IF JX=-4 THEN 1950
2100 CALL POSITION(#1,YP,XP)!check position and store for next sprite
2110 RETURN
2120 REM *************************************************************************level creation************************
2130 DISPLAY AT(1,4):SCORE :: DISPLAY AT(1,16):HEALTH :: DISPLAY AT(1,22):MELEE :: DISPLAY AT(1,27):RANGED !Output GUI
2140 CALL VCHAR(1,4,120):: CALL VCHAR(1,5,121):: CALL VCHAR(1,6,122)!score text gui
2150 CALL VCHAR(1,18,123):: CALL VCHAR(1,24,123):: CALL VCHAR(1,29,123)!Xs gui
2160 CALL VCHAR(1,17,88):: CALL VCHAR(1,23,112):: CALL VCHAR(1,28,113)!hearts,melee,ranged gui
2170 HLE=INT((RND*15)+5)
2180 FOR LVL=1 TO 7
2190 IF LVL=1 THEN 2210
2200 GOSUB 2840 !*************************************GOSUB********LOOT**********
2210 CALL VCHAR(1,1,105,24)!LEFT WALL
2220 CALL VCHAR(1,32,105,24)!RIGHT WALL
2230 CALL HCHAR(LVL*3,1,105,HLE-1)!LEFT SIDE GIRDERS
2240 CALL SPRITE(#SHL,106,1,GRND-3,(HLE*+1)!HOLE PROPER
2250 CALL HCHAR(LVL*3,HLE+3,105,32-(HLE+3))!RIGHT SIDE Girders
2260 CALL HCHAR(LVL*3,HLE,104)!CRUMBLE LEFT SIDE
2270 CALL HCHAR(LVL*3,HLE+2,104)!crumble right side
2280 GRND=GRND+24 :: HOL=INT((RND*15)+5)!NEW LOCATION FOR HOLE
2290 IF HOL=HLE THEN 2280 !NOT EQUAL TO PREVIOUS HOLE
2300 HLE=HOL !SET PROPER HOLE VARIABLE
2310 SHL=SHL+1 !ADVANCE SPRITE #
2320 NEXT LVL !GO CREATE NEXT LEVEL
2330 CALL SPRITE(#10,107,15,22*8,30*! THE EXIT
2340 CALL HCHAR(24,1,105,31)!THE FLOOR
2350 RETURN
2360 REM *****************************************************************************************collision action*******
2370 CALL COINC(#1,#10,4,C):: IF C<>0 THEN 2800 ELSE 2380 !*********collision check against exit
2380 FOR DET=2 TO 8
2390 CALL COINC(#1,#DET,6,C)!*************************************collision check against holes
2400 IF C<>0 THEN 2780 ELSE 2410
2410 NEXT DET
2420 FOR DET=10 TO SLOT !************************collision check against LOOT*********************
2430 CALL COINC(#1,#DET,6,C)
2440 IF C<>0 THEN 2450 ELSE 2760
2450 FOR TLOOP1=1 TO 14
2460 IF LO0T(2,TLOOP1)<>DET THEN 2470 ELSE 2480
2470 NEXT TLOOP1
2480 IF LO0T(1,TLOOP1)<>88 THEN 2550 !heart
2490 SCORE=SCORE+100 :: IF HEALTH<10 THEN HEALTH=HEALTH+1
2500 DISPLAY AT(1,4):SCORE :: DISPLAY AT(1,16):HEALTH :: DISPLAY AT(1,22):MELEE :: DISPLAY AT(1,27):RANGED !Output GUI
2510 CALL VCHAR(1,4,120):: CALL VCHAR(1,5,121):: CALL VCHAR(1,6,122)!score text gui
2520 CALL VCHAR(1,18,123):: CALL VCHAR(1,24,123):: CALL VCHAR(1,29,123)!Xs gui
2530 CALL VCHAR(1,17,88):: CALL VCHAR(1,23,112):: CALL VCHAR(1,28,113)!hearts,melee,ranged gui
2540 GOTO 2750
2550 IF LO0T(1,TLOOP1)<>96 THEN 2620 !zed
2560 SCORE=SCORE+75 ::
2570 DISPLAY AT(1,4):SCORE :: DISPLAY AT(1,16):HEALTH :: DISPLAY AT(1,22):MELEE :: DISPLAY AT(1,27):RANGED !Output GUI
2580 CALL VCHAR(1,4,120):: CALL VCHAR(1,5,121):: CALL VCHAR(1,6,122)!score text gui
2590 CALL VCHAR(1,18,123):: CALL VCHAR(1,24,123):: CALL VCHAR(1,29,123)!Xs gui
2600 CALL VCHAR(1,17,88):: CALL VCHAR(1,23,112):: CALL VCHAR(1,28,113)!hearts,melee,ranged gui
2610 GOTO 2750
2620 IF LO0T(1,TLOOP1)<>112 THEN 2690 !melee
2630 SCORE=SCORE+25 :: MELEE=MELEE+1
2640 DISPLAY AT(1,4):SCORE :: DISPLAY AT(1,16):HEALTH :: DISPLAY AT(1,22):MELEE :: DISPLAY AT(1,27):RANGED !Output GUI
2650 CALL VCHAR(1,4,120):: CALL VCHAR(1,5,121):: CALL VCHAR(1,6,122)!score text gui
2660 CALL VCHAR(1,18,123):: CALL VCHAR(1,24,123):: CALL VCHAR(1,29,123)!Xs gui
2670 CALL VCHAR(1,17,88):: CALL VCHAR(1,23,112):: CALL VCHAR(1,28,113)!hearts,melee,ranged gui
2680 GOTO 2750
2690 IF LO0T(1,TLOOP1)<>113 THEN 2750 !ranged
2700 SCORE=SCORE+50 :: RANGED=RANGED+1
2710 DISPLAY AT(1,4):SCORE :: DISPLAY AT(1,16):HEALTH :: DISPLAY AT(1,22):MELEE :: DISPLAY AT(1,27):RANGED !Output GUI
2720 CALL VCHAR(1,4,120):: CALL VCHAR(1,5,121):: CALL VCHAR(1,6,122)!score text gui
2730 CALL VCHAR(1,18,123):: CALL VCHAR(1,24,123):: CALL VCHAR(1,29,123)!Xs gui
2740 CALL VCHAR(1,17,88):: CALL VCHAR(1,23,112):: CALL VCHAR(1,28,113)!hearts,melee,ranged gui
2750 CALL DELSPRITE(#DET):: GOTO 2790 !TEMP CODE - NEED TO GET PATTERNS TO IDENTIFY LOOT BEFORE BEHAVIOUR
2760 NEXT DET
2770 GOTO 2790
2780 FOR FALL=1 TO 24 :: YP=YP+1 :: CALL SPRITE(#1,44,6,YP,XP):: NEXT FALL !*****FALL**********
2790 RETURN
2800 REM *****************************************************************DEMO RESET*************
2810 CALL DELSPRITE(ALL)
2820 RESTORE 240
2830 GOTO 100
2840 REM ***********************************************************LOOT DISTRIBUTION SYSTEM******
2850 SWITCH=INT(RND*2)+1
2860 FOR LT=1 TO 2
2870 LOOT=INT(RND*4)+1
2880 IF SWITCH=1 THEN 2890 ELSE 2900
2890 SWITCH=-5 :: GOTO 2930
2900 IF SWITCH=2 THEN 2910 ELSE 2920
2910 SWITCH=5 :: GOTO 2900
2920 IF SWITCH=5 THEN SWITCH=-5 ELSE SWITCH=5
2930 IF LOOT<>1 THEN 2970
2940 CALL SPRITE(#SLOT,88,7,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !HEART LOOT
2950 LO0T(LAB,LTN)=88 :: LAB=LAB+1
2960 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
2970 IF LOOT<>2 THEN 3010
2980 CALL SPRITE(#SLOT,96,4,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !ZED
2990 LO0T(LAB,LTN)=96 :: LAB=LAB+1
3000 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
3010 IF LOOT<>3 THEN 3050
3020 CALL SPRITE(#SLOT,112,8,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !MELEE
3030 LO0T(LAB,LTN)=112 :: LAB=LAB+1
3040 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
3050 IF LOOT<>4 THEN 3090
3060 CALL SPRITE(#SLOT,113,14,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !RANGED
3070 LO0T(LAB,LTN)=113 :: LAB=LAB+1
3080 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
3090 NEXT LT
3100 RETURN
3110 REM **********cOLLISION cHECK WALLs
3120 CALL POSITION(#1,YP,XP):: IF XP<=100 THEN 3130 ELSE 3160
3130 CALL COINC(#1,YP,4,8,C):: IF C<>0 THEN 3140 ELSE 3190
3140 CALL LOCATE(#1,YP,13):: CALL MOTION(#1,0,0)
3150 CALL JOYST(1,JX,JY):: IF JX=-4 THEN 3140 ELSE RETURN
3160 CALL COINC(#1,YP,247,8,C):: IF C<>0 THEN 3170 ELSE 3190
3170 CALL LOCATE(#1,YP,239):: CALL MOTION(#1,0,0)
3180 CALL JOYST(1,JX,JY):: IF JX=4 THEN 3170 ELSE RETURN
3190 RETURN

 

 

Edited by Sinphaltimus
Link to comment
Share on other sites

I was a bit worried (at 7 kilobytes (K) using the Size command) that you'd run out of memory before this coming close to a game, but you did it (at 10 K). There are ways to reduce your code size, like merging the run right and run left routines etc., but with your new level generation and ambition to start Assembly soon, I think you'll be just fine.

 

I like your animation, but somehow the standing still graphic seems to need a bit more body / volume. Again, it's hard to make a stick figure in 8 by 8 pixels. Maybe he should simply face the player / background ?

 

Very nice. :thumbsup:

 

I fixed the idle body. :)

  • Like 1
Link to comment
Share on other sites

This latest version 0.24-081516

Level Progression Working with new GUI element. *Pushing Joystick up or down RESETS the game. Board progression works via the EXIT.

Zombies do -1 heart/health damage. 0 health = death. Hearts = +1 health, 10 max.

FIXED*Sometimes holes don't spawn where holes are supposed to spawn causing a "no exit" situation. I dunno why yet.
FIXED*Sometimes loot doesn't spawn where it is supposed to. I dunno why yet.

FIXED*Sometimes the player falls through the girders near or very far from the hole. I dunno why yet.

Known Issues:

It's not done.

To Do Next:
Create attacks for melee and ranged including inventory changes

Create basic zombie AI and animate.

To Do Long Term:

Title screen.

Sounds

Music maybe? - can I play music while player plays game efficiently?

Loot balancing with board progression.

zombie difficulty linked to board progression.

At least 2 more types of ever more difficult zombies.

 

 
100 SCORE=0000 :: HEALTH=10 :: BOARD=1
110 MELEE=0 :: RANGED=0 !weapons inventory
120 CALL SCREEN(2)
130 CALL COLOR(10,15,1):: CALL COLOR(12,12,1):: CALL COLOR(3,12,1):: CALL COLOR(4,12,1)
140 CALL COLOR(8,7,1):: CALL COLOR(11,8,1)
150 CALL CLEAR
160 !running patterns right
170 DATA 1818101010101018,1818183C1C142630,181A3C5E1A334060,18197E981C724100,18197E9818147243,1818385E581C2436
180 !stop and jump right
190 DATA 1818101010101018,000C1C3058081018,00000C1C305C1C18,0000060E183C0C18,0003070C18081018
200 !jumping right
210 DATA 0303040609081010,1818141810106000,1818103810180C00,1818503010180404
220 !landing right
230 DATA 0018183050180818,1818101038501018
240 !running patterns left
250 DATA 1818080808080818,1818183C3828640C,18583C7A58CC0206,18987E19384E8200,18987E1918284EC2,18181C7A1A38246C
260 !stop and jump left
270 DATA 1818080808080818,0030380C1A100818,000030380C3A3818,00006070183C3018,00C0E03018100818
280 !jumping left
290 DATA C0C0206090100808,1818281808080600,1818081C08183000,18180A0C08182020
300 !landing right
310 DATA 0018180C0A181018,181808081C0A0818
320 FOR CHRR=33 TO 38 !setup for creating running characters right
330 READ PAT$
340 CALL CHAR(CHRR,PAT$)
350 NEXT CHRR
360 REM CHR=CHRR
370 FOR CHSR=39 TO 43 !setup for creating stop and jump characters right
380 READ PAT$
390 CALL CHAR(CHSR,PAT$)
400 NEXT CHSR
410 FOR CHJR=64 TO 67 !setup for creating jumping characters right
420 READ PAT$
430 CALL CHAR(CHJR,PAT$)
440 NEXT CHJR
450 FOR CHLR=68 TO 69 !setup for creating landing characters right
460 READ PAT$
470 CALL CHAR(CHLR,PAT$)
480 NEXT CHLR
490 REM left running***********************
500 FOR CHRL=70 TO 75 !setup for creating running characters left
510 READ PAT$
520 CALL CHAR(CHRL,PAT$)
530 NEXT CHRL
540 FOR CHSL=76 TO 80 !setup for creating stop and jump characters left
550 READ PAT$
560 CALL CHAR(CHSL,PAT$)
570 NEXT CHSL
580 FOR CHJL=81 TO 84 !setup for creating jumping characters left
590 READ PAT$
600 CALL CHAR(CHJL,PAT$)
610 NEXT CHJL
620 FOR CHLL=85 TO 86 !setup for creating landing characters left
630 READ PAT$
640 CALL CHAR(CHLL,PAT$)
650 NEXT CHLL
660 BGIR$="3C4426D999A5C3FF" !BAD girder for level HOLE creation
670 GIR$="FFC3A59999A5C3FF" !GIRDER FOR LEVELS
680 CALL CHAR(104,BGIR$,105,GIR$)!girder for level creation
690 GRAV$="FFFFFFFFFFFFFFFF" :: CALL CHAR(106,GRAV$)!THE HOLE
700 EXT$="1F1111111D11111F" :: CALL CHAR(107,EXT$)!THE EXIT
710 HRT$="66FFFFFF7E7E3C18" :: CALL CHAR(88,HRT$)!THE HEART
720 ZED$="3C2418FF9918183C" :: CALL CHAR(96,ZED$)!THE ZED
730 MLE$="C0E0703A1E0C1A01" :: CALL CHAR(112,MLE$)!MELEE
740 RNG$="000000FF7F1E1606" :: CALL CHAR(113,RNG$)!RANGED WEAPONS
750 SCTXT1$="70808063141414E3" :: SCTXT2$="00000000334A4A32" :: SCTXT3$="00000000993C2118" !Word Score
760 CALL CHAR(120,SCTXT1$):: CALL CHAR(121,SCTXT2$):: CALL CHAR(122,SCTXT3$)
770 EXTXT$="0044442810284444" :: CALL CHAR(123,EXTXT$)! the letter X remain for GUI
780 LVLTXT$="E0E080E9EF86EFE9" :: CALL CHAR(124,LVLTXT$)! EX TEXT IN GUI
790 IDLE$="3838107CBA38286C" :: CALL CHAR(44,IDLE$)!***IDLE MAN
800 RANDOMIZE
810 SLOT=11 !STARTING SPRITE NUMBER FOR LOOT
820 OPTION BASE 1
830 DIM LO0T(2,14)
840 LTN=1 !LOOT ARRAY COORDS COL
850 LAB=1 !LOOT ARRAY COORDS ROW
860 SHL=2 :: GRND=17 !START ground level on top girder (YP+8pixels), LEVEL AND SPRITE HOLE #
870 LVL=3 :: YP=9 :: XP=8 :: RS=0 :: CS=16 :: RSPD=2 !start position direction and velocity
880 GOSUB 2140 !*******************************Create Level
890 REM***************************************Create Sprite Idle********
900 CALL SPRITE(#1,44,6,YP,XP)
910 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
920 IF JY=0 THEN 930 ELSE 2680
930 CALL COINC(ALL,C):: IF C=0 THEN 950 ELSE 940 !collision check
940 GOSUB 2360 !collision actions
950 GOSUB 2990 !*************WALL COLLISION CHECK
960 IF S=0 THEN 1630 !no kb pressed check for joyst
970 REM ********jump routine check********
980 CALL MOTION(#1,0,0)
990 IF CS<>-16 THEN 1030
1000 CALL POSITION(#1,YP,XP)!get new position for next sprite
1010 GOSUB 1070 ! goto jump left
1020 GOTO 890
1030 IF CS<>16 THEN 1630
1040 CALL POSITION(#1,YP,XP)!get new position for next sprite
1050 GOSUB 1350 !goto jump right**************************
1060 GOTO 890
1070 REM *************jump left routine*********
1080 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running!
1090 CALL SPRITE(#1,CHSL,6,YP,XP)!recreate sprite1 as stop and jump characters
1100 FOR PT=76 TO 80 !setup stop and jump animation left
1110 CALL PATTERN(#1,PT)!ANIMATE
1120 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1130 NEXT DELAY
1140 NEXT PT !continue animating the stop and jump until done
1150 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping
1160 IF XP<=24 THEN 1260
1170 CS=-20 :: YP=YP-3 :: RS=0 :: CALL SPRITE(#1,CHJL,6,YP,XP,RS,CS)!jumping left
1180 FOR PT=81 TO 84
1190 CALL PATTERN(#1,PT)
1200 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1210 NEXT DELAY
1220 NEXT PT
1230 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1240 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1250 YP=YP+3 !RESET YP TO BE GROUND.
1260 CALL SPRITE(#1,CHLL,6,YP,XP)
1270 FOR PT=85 TO 86 !setup landing animation left
1280 CALL PATTERN(#1,PT)
1290 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1300 NEXT DELAY
1310 NEXT PT ! continue landing animation until last frame
1320 CALL POSITION(#1,YP,XP)!get new position for next sprite
1330 CS=-16
1340 RETURN
1350 REM *************jump right routine******
1360 CS=0 :: CALL MOTION(#1,0,CS)!joystick button pressed so STOP running! right
1370 CALL SPRITE(#1,CHSR,6,YP,XP)!recreate sprite1 as stop and jump characters right
1380 FOR PT=39 TO 43 !setup stop and jump animation right
1390 CALL PATTERN(#1,PT)
1400 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1410 NEXT DELAY
1420 NEXT PT !continue animating the stop and jump until done right
1430 CALL POSITION(#1,YP,XP)!get new postion for animating the jumping right
1440 IF XP>=224 THEN 1540
1450 CS=20 :: YP=YP-3 :: CALL SPRITE(#1,CHJR,6,YP,XP,RS,CS)!jumping right
1460 FOR PT=64 TO 67 !setup jumping characters right
1470 CALL PATTERN(#1,PT)
1480 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1490 NEXT DELAY
1500 NEXT PT
1510 CS=0 :: CALL MOTION(#1,0,CS)!stop motion at end of jumping animation to begin landing animation.
1520 CALL POSITION(#1,YP,XP)!get new position for starting landing animation.
1530 YP=YP+3
1540 CALL SPRITE(#1,CHLR,6,YP,XP)
1550 FOR PT=68 TO 69 !setup landing animation
1560 CALL PATTERN(#1,PT)
1570 FOR DELAY=1 TO 6 !these delays adjusts animation frame rate to match desired rate.
1580 NEXT DELAY
1590 NEXT PT ! continue landing animation until last frame
1600 CALL POSITION(#1,YP,XP)!get new position for next sprite
1610 CS=16
1620 RETURN
1630 REM **************Check Joyst Options************
1640 IF JX<>0 THEN 1670
1650 CALL MOTION(#1,0,0)
1660 GOTO 910
1670 REM ********running check***************
1680 IF JX<>-4 THEN 1710
1690 CALL POSITION(#1,YP,XP)!get new position for next sprite
1700 GOSUB 1940
1710 IF JX<>4 THEN 910
1720 CALL POSITION(#1,YP,XP)!get new position for next sprite
1730 GOSUB 1750
1740 GOTO 910 !after RETURN goto joyst check
1750 REM ************run right routine********
1760 CS=16 :: CALL SPRITE(#1,CHRR,6,YP,XP)!create the runner and send running
1770 CALL MOTION(#1,0,JX*RSPD)
1780 FOR PT=33 TO 38 !setup for animating the run right
1790 CALL PATTERN(#1,PT)
1800 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
1810 CALL COINC(ALL,C):: IF C=0 THEN 1830 ELSE 1820 !collision check
1820 CALL MOTION(#1,0,0):: CALL POSITION(#1,YP,XP):: GOSUB 2360 !collision actions
1830 GOSUB 2990 !*************WALL COLLISION CHECK
1840 IF JY=0 THEN 1850 ELSE 2680
1850 IF JX<>0 THEN 1870 ELSE 1860 !not joy pressed keep running
1860 CALL POSITION(#1,YP,XP):: CALL MOTION(#1,0,0):: CALL SPRITE(#1,44,6,YP,XP):: RETURN
1870 IF JX=4 THEN 1890
1880 IF JX=-4 THEN 1930
1890 CALL MOTION(#1,0,JX*RSPD)
1900 NEXT PT
1910 IF JX=4 THEN 1780
1920 CALL POSITION(#1,YP,XP)!check position and store before stopping motion
1930 RETURN
1940 REM **********run left routine**************
1950 CS=-16 :: CALL SPRITE(#1,CHRL,6,YP,XP)!create the runner and send running
1960 CALL MOTION(#1,0,JX*RSPD)
1970 FOR PT=70 TO 75 !setup for animating the run left
1980 CALL PATTERN(#1,PT)
1990 CALL JOYST(1,JX,JY):: CALL KEY(1,B,S)!check for joystick input (key is for fire button)
2000 CALL COINC(ALL,C):: IF C=0 THEN 2020 ELSE 2010 !collision check
2010 CALL MOTION(#1,0,0):: CALL POSITION(#1,YP,XP):: GOSUB 2360 !collision actions
2020 GOSUB 2990 !*************WALL COLLISION CHECK
2030 IF JY=0 THEN 2040 ELSE 2680
2040 IF JX<>0 THEN 2060 ELSE 2050 !not joy pressed keep running
2050 CALL POSITION(#1,YP,XP):: CALL MOTION(#1,0,0):: CALL SPRITE(#1,44,6,YP,XP):: RETURN
2060 CALL JOYST(1,JX,JY)
2070 IF JX=-4 THEN 2090
2080 IF JX=4 THEN 2130
2090 CALL MOTION(#1,0,JX*RSPD)
2100 NEXT PT
2110 IF JX=-4 THEN 1970
2120 CALL POSITION(#1,YP,XP)!check position and store for next sprite
2130 RETURN
2140 REM *************************************************************************level creation************************
2150 GOSUB 3080 !*************************gui creation******
2160 HLE=INT((RND*15)+5)
2170 FOR LVL=1 TO 8
2180 IF LVL=1 THEN 2200
2190 GOSUB 2720 !*************************************GOSUB********LOOT**********
2200 CALL VCHAR(1,1,105,24)!LEFT WALL
2210 CALL VCHAR(1,32,105,24)!RIGHT WALL
2220 CALL HCHAR(LVL*3,1,105,HLE-1)!LEFT SIDE GIRDERS
2230 CALL SPRITE(#SHL,106,1,GRND-3,(HLE*+1)!HOLE PROPER
2240 CALL HCHAR(LVL*3,HLE+3,105,32-(HLE+3))!RIGHT SIDE Girders
2250 CALL HCHAR(LVL*3,HLE,104)!CRUMBLE LEFT SIDE
2260 CALL HCHAR(LVL*3,HLE+2,104)!crumble right side
2270 GRND=GRND+24
2280 HOL=INT((RND*15)+5)!NEW LOCATION FOR HOLE
2290 IF HOL=HLE THEN 2280 !NOT EQUAL TO PREVIOUS HOLE
2300 HLE=HOL !SET PROPER HOLE VARIABLE
2310 SHL=SHL+1 !ADVANCE SPRITE #
2320 NEXT LVL !GO CREATE NEXT LEVEL
2330 CALL SPRITE(#10,107,15,22*8,30*! THE EXIT
2340 CALL HCHAR(24,1,105,31)!THE FLOOR
2350 RETURN
2360 REM *****************************************************************************************collision action*******
2370 CALL COINC(#1,#10,4,C):: IF C<>0 THEN 2680 ELSE 2380 !*********collision check against exit
2380 FOR DET=2 TO 8
2390 CALL COINC(#1,#DET,6,C)!*************************************collision check against holes
2400 IF C<>0 THEN 2660 ELSE 2410
2410 NEXT DET
2420 FOR DET=10 TO SLOT !************************collision check against LOOT*********************
2430 CALL COINC(#1,#DET,6,C)
2440 IF C<>0 THEN 2450 ELSE 2640
2450 FOR TLOOP1=1 TO 14
2460 IF LO0T(2,TLOOP1)<>DET THEN 2470 ELSE 2480
2470 NEXT TLOOP1
2480 IF LO0T(1,TLOOP1)<>88 THEN 2520 !heart
2490 SCORE=SCORE+100 :: IF HEALTH<10 THEN HEALTH=HEALTH+1
2500 GOSUB 3080 !*************************gui UPDATE******
2510 GOTO 2630
2520 IF LO0T(1,TLOOP1)<>96 THEN 2560 !zed
2530 SCORE=SCORE+75 :: HEALTH=HEALTH-1 :: IF HEALTH<=0 THEN 3140
2540 GOSUB 3080 !*************************gui UPDATE******
2550 GOTO 2630
2560 IF LO0T(1,TLOOP1)<>112 THEN 2600 !melee
2570 SCORE=SCORE+25 :: MELEE=MELEE+1
2580 GOSUB 3080 !*************************gui UPDATE******
2590 GOTO 2630
2600 IF LO0T(1,TLOOP1)<>113 THEN 2630 !ranged
2610 SCORE=SCORE+50 :: RANGED=RANGED+1
2620 GOSUB 3080 !*************************gui UPDATE******
2630 CALL DELSPRITE(#DET):: GOTO 2670 !TEMP CODE - NEED TO GET PATTERNS TO IDENTIFY LOOT BEFORE BEHAVIOUR
2640 NEXT DET
2650 GOTO 2670
2660 FOR FALL=1 TO 24 :: YP=YP+1 :: CALL SPRITE(#1,44,6,YP,XP):: NEXT FALL !*****FALL**********
2670 RETURN
2680 REM *****************************************************BOARD**Progression************
2690 CALL DELSPRITE(ALL):: BOARD=BOARD+1
2700 RESTORE 170
2710 IF JY<>0 THEN 100 ELSE GOTO 120
2720 REM ***********************************************************LOOT DISTRIBUTION SYSTEM******
2730 SWITCH=INT(RND*2)+1
2740 FOR LT=1 TO 2
2750 LOOT=INT(RND*4)+1
2760 IF SWITCH=1 THEN 2770 ELSE 2780
2770 SWITCH=-5 :: GOTO 2810
2780 IF SWITCH=2 THEN 2790 ELSE 2800
2790 SWITCH=5 :: GOTO 2780
2800 IF SWITCH=5 THEN SWITCH=-5 ELSE SWITCH=5
2810 IF LOOT<>1 THEN 2850
2820 CALL SPRITE(#SLOT,88,7,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !HEART LOOT
2830 LO0T(LAB,LTN)=88 :: LAB=LAB+1
2840 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
2850 IF LOOT<>2 THEN 2890
2860 CALL SPRITE(#SLOT,96,4,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !ZED
2870 LO0T(LAB,LTN)=96 :: LAB=LAB+1
2880 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
2890 IF LOOT<>3 THEN 2930
2900 CALL SPRITE(#SLOT,112,8,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !MELEE
2910 LO0T(LAB,LTN)=112 :: LAB=LAB+1
2920 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
2930 IF LOOT<>4 THEN 2970
2940 CALL SPRITE(#SLOT,113,14,GRND-9,((HLE+1)*+SWITCH*:: SLOT=SLOT+1 !RANGED
2950 LO0T(LAB,LTN)=113 :: LAB=LAB+1
2960 LO0T(LAB,LTN)=SLOT-1 :: LAB=1 :: LTN=LTN+1
2970 NEXT LT
2980 RETURN
2990 REM **********cOLLISION cHECK WALLs
3000 CALL POSITION(#1,YP,XP):: IF XP<=100 THEN 3010 ELSE 3040
3010 CALL COINC(#1,YP,4,8,C):: IF C<>0 THEN 3020 ELSE 3070
3020 CALL LOCATE(#1,YP,13):: CALL MOTION(#1,0,0)
3030 CALL JOYST(1,JX,JY):: IF JX=-4 THEN 3020 ELSE RETURN
3040 CALL COINC(#1,YP,247,8,C):: IF C<>0 THEN 3050 ELSE 3070
3050 CALL LOCATE(#1,YP,239):: CALL MOTION(#1,0,0)
3060 CALL JOYST(1,JX,JY):: IF JX=4 THEN 3050 ELSE RETURN
3070 RETURN
3080 REM ********************GUI***********
3090 DISPLAY AT(1,4):SCORE :: DISPLAY AT(1,11):BOARD :: DISPLAY AT(1,16):HEALTH :: DISPLAY AT(1,22):MELEE :: DISPLAY AT(1,27):RANGED !Output GUI
3100 CALL VCHAR(1,4,120):: CALL VCHAR(1,5,121):: CALL VCHAR(1,6,122)!score text gui
3110 CALL VCHAR(1,13,123):: CALL VCHAR(1,18,123):: CALL VCHAR(1,24,123):: CALL VCHAR(1,29,123)!Xs gui
3120 CALL VCHAR(1,12,124):: CALL VCHAR(1,17,88):: CALL VCHAR(1,23,112):: CALL VCHAR(1,28,113)!BOARD,hearts,melee,ranged gui
3130 RETURN
3140 REM ******************************YOU   ARE   DEAD***********************
3150 CALL MOTION(#1,0,0):: CALL DELSPRITE(ALL):: CALL SCREEN(10)
3160 FOR DED=57 TO 73
3170 PRINT "0340";CHR$(DED)
3180 PRINT
3190 CALL KEY(1,K,S):: IF S<>0 THEN 3210
3200 NEXT DED
3210 GOSUB 3080
3220 CALL KEY(1,K,S)
3230 IF S=0 THEN 3220
3240 JY=4
3250 GOTO 2680
 

 

Edited by Sinphaltimus
Link to comment
Share on other sites

DISPLAY AT before CALL VCHAR? Can you elaborate?

 

 

Sure. When creating my gui, I setup my call vchar for the word score and the X . Whenever I put in the display at for the actual score, health and inventory variables it would erase all my call vchar characters on the screen. It took me 2 hours of tweaking everything and triple checking everything three times before I almost caved in and asked the community about this issue that stumped me.

 

Then I started thinking along different lines. Maybe it's a timing thing? Maybe it's like an order of operations thing. Maybe I should try putting the display at command first and the call vchar commands after? Tried that and BINGO!

 

SO APPARENTLY, display at trumps call vchar in some kind of internal drawing layers thing in the VDP I suppose.

 

EDIT: Although I'm developing and testing in Emulation so that might have something to do with it. classic99.

Edited by Sinphaltimus
Link to comment
Share on other sites

Sure. When creating my gui, I setup my call vchar for the word score and the X . Whenever I put in the display at for the actual score, health and inventory variables it would erase all my call vchar characters on the screen. It took me 2 hours of tweaking everything and triple checking everything three times before I almost caved in and asked the community about this issue that stumped me.

 

Then I started thinking along different lines. Maybe it's a timing thing? Maybe it's like an order of operations thing. Maybe I should try putting the display at command first and the call vchar commands after? Tried that and BINGO!

 

SO APPARENTLY, display at trumps call vchar in some kind of internal drawing layers thing in the VDP I suppose.

 

EDIT: Although I'm developing and testing in Emulation so that might have something to do with it. classic99.

 

Nothing unusual going on here. DISPLAY AT blanks the rest of the line unless you use SIZE() to specify the field width (see the XB manual <<edit).

 

There are no drawing layers except for sprites. DISPLAY AT and CALL VCHAR both write directly to the same VRAM block.

 

...lee

  • Like 1
Link to comment
Share on other sites

Lee, you never cease to amaze me. Thank you for today's lesson on RTFM'ing- lol. Learn something new every day. Love it. But you had to see and hear me when I discovered swapping the command worked. You'd have thought I hit the lotto. I've missed those feels...the ah-ha's of self discovery. The exact same feeling I fondly remember this machine for....

 

 

Edit: I'm unable to find Size(), only SIZE which reports remaining ram? Still looking...

Edited by Sinphaltimus
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...