Like I said I never learnt how CLEAR works! (I'm guessing it rebases the stack? - aren't the UDGs in high memory though? Are they above the stack by default?). I suppose it would be better to do that (use a byte array) than do any horrible hacks like use a string variable and encode row and column data using ASC and CHR$ or whatever it is. Then I wouldn't have to worry about the arrays starting at offset 1 either! Main gripe with an array is that arrays of variables (not strings) are 5 bytes per element I think? So it has to do readloc = base + 5 * index every access then, whereas if I use POKE and PEEK it is all super easy. If only Basic had pointers...
ok, tried doing something in basic, and very painfully too :) (not to repeat soon)
damn those key combinations!
using dims for the snake last coordinates, it works and looks fast, see what do you think of it:
5 BORDER 0:CLS
10 LET X=10:LET Y=10
11 DIM A (20)
12 DIM B (20)
13 LET COUNT=1
14 LET XM=0:LET YM=0
15 LET END=15:REM SNAKE SIZE
20 PRINT AT X,Y;"O"
30 IF INKEY$="p" THEN LET YM=1:GOSUB 500
40 IF INKEY$="o" THEN LET YM=-1:GOSUB 500
50 IF INKEY$="q" THEN LET XM=-1:GOSUB 500
60 IF INKEY$="a" THEN LET XM=1:GOSUB 500
100 GOTO 20
500 REM MOVE HEAD
510 LET X=X+XM
520 LET Y=Y+YM
530 LET A(COUNT)=X
540 LET B(COUNT)=Y
550 LET COUNT=COUNT+1
560 IF COUNT=END+1 THEN LET COUNT=1
570 LET XM=0:LET YM=0
575 PRINT AT A(COUNT),B(COUNT);" "
580 RETURN
How do I get that into the speccy? I guess I have to download BASin or something?
You've been clever and don't keep track of the start either, or is that a bug ;). If it works it saves another variable... not sure if that would work correctly if the snake changes size? You have 20 entries in each array and END is just constant (good way to start off moving though that).
yes, basin should work, i did it in an emulator,
like it is its just erasing the last coordinate - the end variable,
for the size changing during gameplay there should be no problem, just as long as it does not get bigger than the array :)
hmm, yes, and that is a waste of time indeed, should only delete the last segment, ill try to change it .
if i change to :
if a(count)>0 then print at a(count),b(count);" "
it doesn?t print at 0,0 anymore, but if the snake can?t pass there also :)
Well you do only delete 1 segment, it just may not be in the right place. I'll probably go for a start and end variable anyway [like my pseudocode I posted earlier], although your method has given me an idea for starting out (snake grows 1 segment at a time rather than starts off fully drawn).
Who is writing this crap game anyway? Isn't it supposed to be me? I WILL SUE YOUR ASS OFF IF YOU RELEASE GAME BASED ON MY SNAKETECH v2.0 ENGINE!
Although looking at that code and wanting to step through it and watch the variables is already making me loath to start programming in ZX Basic. I guess I'll have to log everything to a logfile instead :D
Does SPIN have a step function for stepping through basic programs and a way to watch basic variables? I hope so ;)
hmm, yes, and that is a waste of time indeed, should only delete the last segment, ill try to change it .
if i change to :
if a(count)>0 then print at a(count),b(count);" "
it doesn?t print at 0,0 anymore, but if the snake can?t pass there also :)
Initialise a to all -1: then you can test for >= 0.
Would either of these two creatures qualify as an otter, or do both look more like swamp rats? The one in the upper left is 3x1 UDG, the other is 3x2, a.k.a. cow sized.
10 DATA 0,3,7,7,7,15,31,241,248,252,255,255,255,255,131,225
11 DATA 0,0,224,254,255,255,224,32,0,62,127,127,255,127,7,15
12 DATA 0,31,255,255,255,255,255,255,0,192,240,248,248,252,254,255
13 DATA 3,2,0,0,0,0,0,0,129,1,0,31,127,0,0,0,255,231,7,15,255,248,0,0,-1
14 LET a=USR "a"
15 READ b:IF b<>-1 THEN POKE a,b:LET a=a+1:GO TO 15
16 BRIGHT 1:PAPER 7:INK 0:CLS:PRINT AT 10,10;"{A}{B}{C}"
17 PRINT AT 12,15;"{D}{E}{F}";AT 13,15;"{G}{H}{I}"
Would either of these two creatures qualify as an otter, or do both look more like swamp rats? The one in the upper left is 3x1 UDG, the other is 3x2, a.k.a. cow sized.
Outstanding! Both work well in my opinion, if I was nitpicking the top left one is ever so slightly stoaty. Hope they turn up in CGC entry.
Just imagine a real life sponsored otter swimming around the British countryside with YOUR name on it people.
Strewth cobbers, this goes off like a frog in a sock! I've needed this for fifteen years!
Where's me fourex, I'm drier than a goanna's nutsack mate.
Bruce.
As I have a few unfinished (hardly even started) cow themed games, I may consider adding a character selection that lets you choose which type of animal you wish to play as/with/against. Any Speccy owner with some networking device then could fetch DLC with character packs for future updates. The game would still be the same, just different graphics... :razz:
The scary thing is Mr. R-Tape your hosting of the CGC seems to be responsible for churning out too many decent games.
The carp has grown too fat, and after the compo it'll no doubt be forced to live out the rest of it's life hiding from people behind a twig sized branch in terror inside an undersized aquarium at the back of a Chinese restaurant :p
The scary thing is Mr. R-Tape your hosting of the CGC seems to be responsible for churning out too many decent games.
The carp has grown too fat, and after the compo it'll no doubt be forced to live out the rest of it's life hiding from people behind a twig sized branch in terror inside an undersized aquarium at the back of a Chinese restaurant :p
The baseline quality is worrying high isn't it! Thank heavens for the likes of Lee Spoons and RebelstarWAC :-P
The baseline quality is worrying high isn't it! Thank heavens for the likes of Lee Spoons and RebelstarWAC :-P
Fancy submitting something dm?
I'm still having trouble with actually emulating a Speccy on this PC, I can play games, and that's a bit of a faff. I can't even edit JSW now (and from the sounds of things me and Jammajup were the only people keeping that alive right now) :(
I do have an idea though which will no doubt bring a smile to some peoples faces if I do it, and I'm sure at least some of the people on here will get the gag.
If I do it it'll be a text adventure based on an 80's TV show, I won't go into too many details as it might not happen?
Ha, that's almost as crap as one of my efforts. Well done! What's wrong with Bognor anyway?.
The Rhyll bit made me laugh, I've never been but have heard plenty of not so complimentary things about it. Can't believe Blackpool didn't get a mention (go to Morecambe instead - much nicer).
Oh dear, I'm having a dilemma! The input in my latest game is dodgy; sometimes it seems to register and sometimes it doesn't. Now a part of me wants to debug and fix the algorithm so the input works like it should, but the other part says this is the Crap Games Competition and dodgy input is almost expected in a game of that quality. Hmm...
Edit: Couldn't help myself, so I had to fix the input somewhat. Now the game plays, but offers close to zero challenge or possibility for the player to control the outcome. We'll see if I do something about it or just tidy it up and contribute it. My previous game was mostly a date with Lady Luck, so perhaps the next one should give the player some choices.
Comments
damn those key combinations!
using dims for the snake last coordinates, it works and looks fast, see what do you think of it:
5 BORDER 0:CLS
10 LET X=10:LET Y=10
11 DIM A (20)
12 DIM B (20)
13 LET COUNT=1
14 LET XM=0:LET YM=0
15 LET END=15:REM SNAKE SIZE
20 PRINT AT X,Y;"O"
30 IF INKEY$="p" THEN LET YM=1:GOSUB 500
40 IF INKEY$="o" THEN LET YM=-1:GOSUB 500
50 IF INKEY$="q" THEN LET XM=-1:GOSUB 500
60 IF INKEY$="a" THEN LET XM=1:GOSUB 500
100 GOTO 20
500 REM MOVE HEAD
510 LET X=X+XM
520 LET Y=Y+YM
530 LET A(COUNT)=X
540 LET B(COUNT)=Y
550 LET COUNT=COUNT+1
560 IF COUNT=END+1 THEN LET COUNT=1
570 LET XM=0:LET YM=0
575 PRINT AT A(COUNT),B(COUNT);" "
580 RETURN
You've been clever and don't keep track of the start either, or is that a bug ;). If it works it saves another variable... not sure if that would work correctly if the snake changes size? You have 20 entries in each array and END is just constant (good way to start off moving though that).
like it is its just erasing the last coordinate - the end variable,
for the size changing during gameplay there should be no problem, just as long as it does not get bigger than the array :)
if i change to :
if a(count)>0 then print at a(count),b(count);" "
it doesn?t print at 0,0 anymore, but if the snake can?t pass there also :)
Who is writing this crap game anyway? Isn't it supposed to be me? I WILL SUE YOUR ASS OFF IF YOU RELEASE GAME BASED ON MY SNAKETECH v2.0 ENGINE!
Although looking at that code and wanting to step through it and watch the variables is already making me loath to start programming in ZX Basic. I guess I'll have to log everything to a logfile instead :D
Does SPIN have a step function for stepping through basic programs and a way to watch basic variables? I hope so ;)
Initialise a to all -1: then you can test for >= 0.
i satisfied my nostalgia of coding zxbasic :) at least in the real editor.
10 DATA 0,3,7,7,7,15,31,241,248,252,255,255,255,255,131,225 11 DATA 0,0,224,254,255,255,224,32,0,62,127,127,255,127,7,15 12 DATA 0,31,255,255,255,255,255,255,0,192,240,248,248,252,254,255 13 DATA 3,2,0,0,0,0,0,0,129,1,0,31,127,0,0,0,255,231,7,15,255,248,0,0,-1 14 LET a=USR "a" 15 READ b:IF b<>-1 THEN POKE a,b:LET a=a+1:GO TO 15 16 BRIGHT 1:PAPER 7:INK 0:CLS:PRINT AT 10,10;"{A}{B}{C}" 17 PRINT AT 12,15;"{D}{E}{F}";AT 13,15;"{G}{H}{I}"Strewth cobbers, this goes off like a frog in a sock! I've needed this for fifteen years!
Where's me fourex, I'm drier than a goanna's nutsack mate.
Bruce.
Outstanding! Both work well in my opinion, if I was nitpicking the top left one is ever so slightly stoaty. Hope they turn up in CGC entry.
Just imagine a real life sponsored otter swimming around the British countryside with YOUR name on it people.
:lol:
And perfect time for the Ashes!
The carp has grown too fat, and after the compo it'll no doubt be forced to live out the rest of it's life hiding from people behind a twig sized branch in terror inside an undersized aquarium at the back of a Chinese restaurant :p
The baseline quality is worrying high isn't it! Thank heavens for the likes of Lee Spoons and RebelstarWAC :-P
Fancy submitting something dm?
I'm still having trouble with actually emulating a Speccy on this PC, I can play games, and that's a bit of a faff. I can't even edit JSW now (and from the sounds of things me and Jammajup were the only people keeping that alive right now) :(
I do have an idea though which will no doubt bring a smile to some peoples faces if I do it, and I'm sure at least some of the people on here will get the gag.
If I do it it'll be a text adventure based on an 80's TV show, I won't go into too many details as it might not happen?
You take that back! Lee Spoons is a genius!
Alan Whicker Simulator
By Andrew Green.
This makes the final tape # the Cassette 60, hope the final number turns out to be a catchy one.
And what's happened to Kweepa? 38 squidillion carp games in 3 months, then nothing.
The Rhyll bit made me laugh, I've never been but have heard plenty of not so complimentary things about it. Can't believe Blackpool didn't get a mention (go to Morecambe instead - much nicer).
I'm hoping he's going to produce a few more games, he's only 3 from the most entries ever in one year.
AWFTRBTSFTVOTWWPRSWWSBASS
By field marshall Spoons.
Did yesterday's historic and touching events cause your eyes or your mouth to water? Either way this is the utility for YOU!
The spectrum community really has it's collective finger on the pulse! :p
Neither of those represent an UDG, for that matter.
Interesting...does the number 50 have any significance?
Pixy the Pixel.
If you squint you can see it.
By Lee Spoons.
No more CGD made crap games from Lee now until he supplies a good CGD game (not submitted the CGC) :p (non CGD entries accepted as normal).
Edit: Couldn't help myself, so I had to fix the input somewhat. Now the game plays, but offers close to zero challenge or possibility for the player to control the outcome. We'll see if I do something about it or just tidy it up and contribute it. My previous game was mostly a date with Lady Luck, so perhaps the next one should give the player some choices.