New version of Space Invaders (was: BASIC Space Invaders)

avtovaz
Posts: 89
Joined: Wed Jan 18, 2017 5:09 pm
Contact:

Re: BASIC Space Invaders

Post by avtovaz »

tricky , right ill have a read! thats interesting!


syd, thats exactly the lessons i wanted! i just did the first part with 3 coloured blocks, and i can see a,x,y now ill work threw this and hopefulyl till make sence!
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

Sorry the code in this is so poorly laid out, I was writing it for a BASIC programming competition, but BASIC just isn't great for 50fps arcade games.

Added a moving player ship (Z,X) and bombs killing you, although they just STOP the program for now and I think it can kill you without hitting you but I haven't debugged it.

I hope that even though the code is not great, it is giving an idea of how I approach writing a game.
I usually write the technical bit that proves the game can be done (not necessary here), and turn that in to something visually appealing, so that I feel motivated to continue. I then just add things as I think of them, trying to balance getting bored with not leaving all the boring bits to the end.
I try to put in placeholders for things that will come later that may be a pain to add then, this isn't always the most productive way, but can help prevent coding yourself into a corner (like Phoenix) where there is a lot that needs re-writing to "do it properly".
Attachments
BasicInvaders.zip
(10.93 KiB) Downloaded 141 times
Tom_Lindberg
Posts: 75
Joined: Sun Jun 19, 2016 12:33 am
Location: Sola, Norway
Contact:

Re: BASIC Space Invaders

Post by Tom_Lindberg »

avtovaz wrote:tricky , right ill have a read! thats interesting!


syd, thats exactly the lessons i wanted! i just did the first part with 3 coloured blocks, and i can see a,x,y now ill work threw this and hopefulyl till make sence!
And if you want a book I can recommend 'Discovering BBC Micro Machine Code' by A. P. Stephenson. A very pedagogic introduction for beginners. A joy to read! You can find a scan of it halfway down on this page:

http://www.8bs.com/othrdnld/manuals/publications.shtml
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

Small update tonight, sorry.
You can now shoot (RETURN) although you can't hit anything :lol: and occasionally a bullet gets left on screen at startup.
Attachments
BasicInvaders.zip
(11.45 KiB) Downloaded 132 times
fuzzel
Posts: 1191
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: BASIC Space Invaders

Post by fuzzel »

Tom Lindberg wrote:
"And if you want a book I can recommend 'Discovering BBC Micro Machine Code' by A. P. Stephenson. A very pedagogic introduction for beginners."

Thanks for the link to the bbc books scans Tom. There are a few adventure writing books which I'll be sure to read.
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

Sorry, I had to go to assembler and beebasm, I guess I'm just too used to the modern comforts.
Asm and data included, so that you can see how what was left as BASIC has converted to asm.
I haven't quite finished converting it, things like the ship is hidden until you move, but you get the idea.
All the nice easy bits like drawing the text on the screen are missing as it is a bit more of a faff to put them back, but I will eventually.
I've also started to re-expand some of the variable names, now that I don't run out of memory assembling.
The code should be "legal" except the direct access to screen memory, but that should be compatible.
When finished, it should be an easy port to the ATOM (but not by me) and should be "snow free", don't know about the Electron.
Sorry for all the woffling and for starting a game that we really didn't need!
Attachments
BasicInvaders.zip
(9.43 KiB) Downloaded 150 times
User avatar
dhr2
Posts: 173
Joined: Tue Oct 25, 2016 8:37 pm
Contact:

Re: BASIC Space Invaders

Post by dhr2 »

Cool stuff. Where's the BASIC competition being held? I searched the forum but couldn't seem to find it.
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

I can't find it myself now, I'll have another look tomorrow!
avtovaz
Posts: 89
Joined: Wed Jan 18, 2017 5:09 pm
Contact:

Re: BASIC Space Invaders

Post by avtovaz »

stillquite nerw to using the mmb files etc

i used linux so i opened oracle box to run windows, and then opened teh mmc file programs.

I dragged and dropped invaders ssd onto a disk and then put it into the bbc. It just says bad program after its loaded in.


I put elite onto another disk too ad that does the same.
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

You could try dragging a copy of the mmb and running it in an emulator, so at least you know the image is OK.
You could also try creating a disc on the beeb, writinga file to it and seeing if you can read it on the Mac.
I still have quite a bit of work to do on invaders and am currently sidetracked completing some 30 year old line drawing routines.
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

Did a bit on the attract screen, loosing lives and game over tonight - new wave isn't initialised properly after game over.
You can shoot, but can't hit anything and the aliens are not very good shots!
No sound, no spaceship etc either!
Z,X and RETURN to start and fire (harmless bullets)!
Attachments
game.zip
WiP
(2.94 KiB) Downloaded 141 times
User avatar
FourthStone
Posts: 1527
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: BASIC Space Invaders

Post by FourthStone »

Coming along nicely Tricky =D>
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

I was just adding hitting aliens, when i realised that i had over optimised the storage and iterating of the invaders. What i did make it harder to find which invader was hit and whicho invader should​ shoot and very tricky to not mess up when you shoot the alien just moved or just about to move.
That is what comes of trying to make it fast enough in basic. It is more frustrating, because things were going very quickly as i wasn't having to skrimp on memory like i usually have to.
Oh well, on holiday next week so i might get something done then.
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

Another little update tonight, now you can shoot the aliens and they explode with about as close as I can get to the explosion sound (so, not very close :lol: )
If anyone has a sounds that match those in the arcade game, I would be pleased to include them, with a credit if you like.
As this started out as a BASIC game, I'm trying to be legal, so a series of sound statements is fine, even an envelope should work!

If you clear the level, you will be rewarded with the game crashing :lol:
Z, X and RETURN
Attachments
game.zip
(3.18 KiB) Downloaded 114 times
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

Added a few sounds effects, still no saucer and after the first level, you can get invisible bombs.
No joystick support yet, still Z,X and RETURN.
I haven't really checked for bugs and attract mode still needs sorting.

EDIT: disk image added, sorry.
Attachments
BInvaders.zip
(3.28 KiB) Downloaded 125 times
Last edited by tricky on Mon Apr 03, 2017 8:26 am, edited 2 times in total.
User avatar
Arcadian
Site Admin
Posts: 4223
Joined: Fri Nov 24, 2000 12:16 pm
Contact:

Re: BASIC Space Invaders

Post by Arcadian »

No attachment Tricky!! ;)
Please subscribe to the ABug YouTube channel!
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

Sorry, added above.
User avatar
timmy
Posts: 172
Joined: Thu Apr 27, 2006 1:19 pm
Contact:

Re: BASIC Space Invaders

Post by timmy »

Excellent stuff Tricky!
User avatar
Kecske Bak
Posts: 752
Joined: Wed Jul 13, 2005 8:03 am
Location: Mélykút, Hungary
Contact:

Re: BASIC Space Invaders

Post by Kecske Bak »

Wonderful stuff. I had a play with this yesterday and I'm really impressed. The thing that always interests me about tricky's games is they never look like they are running on a BBC, which is something almost unique as usually you can tell straight away if a game is running on a Beeb.
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

Thanks, i think that is helped, by being in mode 1 with palette switching giving more than 4 colours.
For this game, it doesn't do any tricks and even the font is just the beeb font shifted one pixel and anded with itself.
I guess that using the original graphics and animations and running in a portrait resolution gives a feel of the original game and helps the suspension of disbelief ;)
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

Another small update, I wish I liked this game more!

TODO:
  • spawn saucers
    disallow invisible bombs
    clear bombs and explosions after death
    end game when squashed
    GAME OVER
    improve sounds
Any other suggestions?
Attachments
BInvaders.zip
(3.58 KiB) Downloaded 92 times
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

Tidied up a bit, still doesn't end when you get "landed" on.
It is actually starting to feel like Space Invaders now.
Attachments
BInvaders.zip
(3.66 KiB) Downloaded 110 times
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

Improved attract mode and added an abrupt end of game if the invaders "land".
screenshots.png
Attachments
BInvaders.zip
(3.69 KiB) Downloaded 108 times
User avatar
PitfallJones
Posts: 455
Joined: Fri Feb 22, 2008 3:44 pm
Contact:

Re: BASIC Space Invaders

Post by PitfallJones »

Wow! This is absolutely amazing! (Apart from from the fire sound that sucks)
- it made me remember the first time I ever played it which was on one of those cocktail sitdown machines...
Love how you've done the colours (the original was monochrome with the colour overlay as I remember ...)

Please, Please, Please do Lunar Rescue (Not Lander!) next... that was the other cocktail one I used to play...

PJ

P.S. The upside down Y stuff is a lovely attention to delail....
User avatar
FourthStone
Posts: 1527
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: BASIC Space Invaders

Post by FourthStone »

Really looking good Tricky, always amazes me that it can take months to do all the final polishing but when done well the results are amazing and worth all the effort, well done sir =D>

Now to get back to procrastinating on my projects... :lol:
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

Can anyone think of a beeb game with an appropriate sound effect for the firing noise in Space Invaders?
Any game on any platform using the beeb's SN76489 will probably do.
I tried for many hours to get the high pitched whistle right, but just couldn't do it (sound is definitely one of my weakest points).
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

OK, less horrible shooting sound effects, hopefully reminiscent of the real thing.

EDIT:
I did look at lunar rescue, as I know someone else who likes it, but wasn't sure how popular it was.
Lunar Lander is on the list, but quite a way down!
Lunar rescue looked good for an emulator like my Sprint, Circus and RipCord beeb emulators, but not being a 6502 game, it would be too much work.

Another problem with lunar rescue is that I'm not very good at it and would have to rely on youtube video to get the game play correct!
Attachments
SpaceInvaders.zip
(3.72 KiB) Downloaded 117 times
User avatar
FourthStone
Posts: 1527
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: BASIC Space Invaders

Post by FourthStone »

All I hear when shooting is a high pitched squelch which lasts as long as the bullet is alive.

This vid has the closest sound I've heard, the game even has the upside down Y being fixed by the invader.

https://www.youtube.com/watch?v=LTyozRUeWKo

Sounds like a gas valve being released maybe?

Don't have any sounds for you other than that sorry :oops:
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

I have the original sound, but it is proving very hard to reproduce with the beeb's sound chip.
My partner asked me why I didn't just download a WAV and play that :roll:
I may actually have to do that, although it would go against trying to make an OS "legal" game (apart from screen memory access of course).
The current sound is basically

Code: Select all

SOUND 0,-4,  7,15
SOUND 1, 0,255,15
SOUND 3,-2,240,15
I was looking for a game with a similar sound effect and similar hardware to the beeb (so I could steal it) but can't find any.
I may try the speech chip as that may have something appropriate, or I do have lots of CPU cycles spare, so playing a sample isn't out of the question (but it does seem like overkill).
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: BASIC Space Invaders

Post by tricky »

OK, here it is, only tried it on b-em and beebem in model B mode.
Full source (beebasm, thanks RichTW) is included, loading screen (partially converted with image2mode7, thanks kieranhj), and graphics as EQUB statements; copy the data to screen memory to visualise it.
Joystick and keyboard supported, it isn't polished, but is actually growing on me, so it may get revisited later.
I usually score a little over 3600.
I will fix any bugs or compatibility issues reported.
Richard

URL:http://youtu.be/N3TK3CLQCRA
Attachments
Loading.png
SpaceInvaders.zip
(15.81 KiB) Downloaded 133 times
Last edited by tricky on Tue Apr 18, 2017 10:34 pm, edited 1 time in total.
Post Reply

Return to “trickysoft (new bbc micro games)”