I built a game in BASIC

Show us what you're working on, (preferably with screenshots).
User avatar
5MinuteRetro
Manic Miner
Posts: 755
Joined: Mon Nov 13, 2017 12:21 pm
Location: UK
Contact:

Re: I built a game in BASIC

Post by 5MinuteRetro »

Magnus wrote: Mon Mar 25, 2019 11:04 am Sorry if this was a bit cryptic, but if you add the line I suggested, the program would print 255 in the upper left corner of the screen if my theory is correct and bit 6 is set. It doesn't solve anything though, the emulator should be modified in that case.
Still not entirely sure what this is meant to do but... I just added the line successfully. The number 255 does indeed appear at the top-left corner, and the it changes as I press the game's control keys, so clearly the code knows I'm inputting something -- but still no movement from the ship. :(
Retro stuff, real quick
YouTube: http://bit.ly/5MinuteRetro
Twitter: https://twitter.com/5MinuteRetro
User avatar
Morkin
Bugaboo
Posts: 3251
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: I built a game in BASIC

Post by Morkin »

Had a go at it, it's a nice game and very responsive considering it's written in BASIC. I didnt managed to see all the levels but broke into the game so I could see them, along with the victory screen.. :oops:

So was it completely written on a Speccy? If so, the discussions about getting it to work on various emulators is quite funny, it's usually the other way round.. :lol:
My Speccy site: thirdharmoniser.com
Magnus
Dizzy
Posts: 61
Joined: Sat Jan 06, 2018 6:47 am
Location: Sweden

Re: I built a game in BASIC

Post by Magnus »

5MinuteRetro wrote: Mon Mar 25, 2019 11:35 am
Magnus wrote: Mon Mar 25, 2019 11:04 am Sorry if this was a bit cryptic, but if you add the line I suggested, the program would print 255 in the upper left corner of the screen if my theory is correct and bit 6 is set. It doesn't solve anything though, the emulator should be modified in that case.
Still not entirely sure what this is meant to do but... I just added the line successfully. The number 255 does indeed appear at the top-left corner, and the it changes as I press the game's control keys, so clearly the code knows I'm inputting something -- but still no movement from the ship. :(
Well, that confirms my theory at least :). Maybe the author would be kind enough to change the code to use inkey$ as Ast A. Moore proposed in a previous post. Or, you could give it a try yourself.
My ZX Spectrum emulator project: https://softspectrum48.weebly.com.
Magnus
Dizzy
Posts: 61
Joined: Sat Jan 06, 2018 6:47 am
Location: Sweden

Re: I built a game in BASIC

Post by Magnus »

Morkin wrote: Mon Mar 25, 2019 1:06 pm Had a go at it, it's a nice game and very responsive considering it's written in BASIC. I didnt managed to see all the levels but broke into the game so I could see them, along with the victory screen.. :oops:

So was it completely written on a Speccy? If so, the discussions about getting it to work on various emulators is quite funny, it's usually the other way round.. :lol:
Yes, it's a much better situation for us emulator authors :D.
My ZX Spectrum emulator project: https://softspectrum48.weebly.com.
User avatar
Hedge1970
Manic Miner
Posts: 388
Joined: Mon Feb 18, 2019 2:41 pm

Re: I built a game in BASIC

Post by Hedge1970 »

Hehe the irony is not lost on me, editing a game built in a zx spectrum so it works on a zx spectrum emulator :-)

I will make the inkey() change plus add recognition that you’ve set a new high score and there are a couple of bugs that I might try and solve. Won’t be able to do anything till next week though - sry.

Thanks again for all the positivity
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: I built a game in BASIC

Post by Ast A. Moore »

Hedge1970 wrote: Tue Mar 26, 2019 8:43 am Hehe the irony is not lost on me, editing a game built in a zx spectrum so it works on a zx spectrum emulator :-)
Well, it’s not so much the fault of an emulator as one of the quirks of the Spectrum itself. Some emulators have an option of enabling or disabling the pre–Issue 3 Spectrum keyboard behavior; others don’t. In this instance, the game was (presumably) developed on a later 48K Speccy, which returns a different value of Bit 6 upon reading from port 254. As is, the game wouldn’t work on real Issue 1 and Issue 2 Spectrums either.

There were a bunch of commercial games that suffered from the same problem, so in that respect the game is as genuine as they come. ;)
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
Joefish
Rick Dangerous
Posts: 2042
Joined: Tue Nov 14, 2017 10:26 am

Re: I built a game in BASIC

Post by Joefish »

Can't you just put something in the code to, e.g. do an IN on the title screen when no keys are pressed, then put that in a variable and then do something like key = var - IN xxxxx to work out the key being pressed? That way you don't lose the ability to move diagonally, as you do with INKEY$.

I think the use of keys B/N for left/right so they're in separate IN commands is clever, though you don't need to detect both of those pressed at once so O/P with the same IN isn't too hard.

It's a good game and very fast and responsive for BASIC. I did think about the suggestion of a penalty for missing a drop, but losing time is probably all the penalty you need. I do think the time limit is a bit tight though, especially as the third screen gets very crowded. You may have got too good at your own game while working on it!
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: I built a game in BASIC

Post by Ast A. Moore »

Joefish wrote: Tue Mar 26, 2019 11:08 am That way you don't lose the ability to move diagonally, as you do with INKEY$.
I don’t think the ship can move diagonally now, so, nothing is lost.
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Post Reply