English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 29 October 2020, 13:37   #21
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Wasn't sure about this but have moved on anyway. Just sorting Types...
Havie is offline  
Old 29 October 2020, 15:37   #22
rothers
Registered User
 
Join Date: Apr 2018
Location: UK
Posts: 490
The arcade just moves the player and 1 invader per frame, that's why it ripples & speeds up as you shoot them.

You should copy that behaviour for speed and accuracy.
rothers is offline  
Old 29 October 2020, 16:54   #23
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Thumbs up

Quote:
Originally Posted by rothers View Post
The arcade just moves the player and 1 invader per frame, that's why it ripples & speeds up as you shoot them.

You should copy that behaviour for speed and accuracy.
Yep - that's what I've done. The issue I have is I'm running 50fps (UK) but arcade was 60fps.
Havie is offline  
Old 29 October 2020, 23:12   #24
Toki
Registered User
 
Toki's Avatar
 
Join Date: Feb 2016
Location: Birmingham
Age: 60
Posts: 107
Thanks Havie.
It moves nicely. Would it be possible for you to load the BB file to the Zone? I'm keen to see how you have managed this. this is just what I need to understand how BB works. Superb effort! Like the computer archeology link too!
Toki is offline  
Old 30 October 2020, 12:44   #25
rothers
Registered User
 
Join Date: Apr 2018
Location: UK
Posts: 490
Quote:
Originally Posted by Havie View Post
Yep - that's what I've done. The issue I have is I'm running 50fps (UK) but arcade was 60fps.
Ah great, so many people get that behaviour wrong in space invaders games!

The arcade was 2 colours with strips of coloured plastic on the screen, the idea of 'emulating' the strips of plastic with a palette change as you draw down the screen would be really cool because it would also emulate the clash the arcade suffered from.
rothers is offline  
Old 01 November 2020, 22:49   #26
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Quote:
Originally Posted by Toki View Post
Thanks Havie.
It moves nicely. Would it be possible for you to load the BB file to the Zone? I'm keen to see how you have managed this. this is just what I need to understand how BB works. Superb effort! Like the computer archeology link too!
Sorry - been busy with other things and not had too much time for programming. I have got a bit further, you base fires and can destroy invaders but struggling to keep invaders together as the move down at the edge of the screen so this code is too buggy to upload (will do so when sorted) BUT here is the original code for the demo uploaded:

http://eab.abime.net/zone/invaders0.1

I hope this helps!
Havie is offline  
Old 01 November 2020, 22:51   #27
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Quote:
Originally Posted by rothers View Post
Ah great, so many people get that behaviour wrong in space invaders games!

The arcade was 2 colours with strips of coloured plastic on the screen, the idea of 'emulating' the strips of plastic with a palette change as you draw down the screen would be really cool because it would also emulate the clash the arcade suffered from.
Have realised that to do this I would have to not use sprites (as they have their own palette) - not a problem I think as at most I'll be blitting 1 invader, 1 base, 1 player shot, 3 invader missiles and 1 ufo - 7 blits per frame should be fine especially in 4 bit planes.

Once I sort out the movement code to my satisfaction, I will change the sprites to bobs and try to get this working with the Rainbow command.
Havie is offline  
Old 01 November 2020, 22:53   #28
Toki
Registered User
 
Toki's Avatar
 
Join Date: Feb 2016
Location: Birmingham
Age: 60
Posts: 107
Keep up the good work Havie.
Toki is offline  
Old 13 November 2020, 23:16   #29
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Quick update as haven't had too much time to work on this.

Have got rid of sprites and everything is now drawn on a four colour screen using blits. I have faked the overlay using DisplayRGB commands and this works really well - hence the need to get rid of the sprites (thanks to Daedalus for his help).

Had to change the collision detection (as no longer using sprites) but this was reasonably simple and also used Point command to check if you have hit one of the shields.

Invaders now also blow up.

Still struggling with invader movement - left and right is fine - but I have obviously got something wrong with my logic for going down as it sort of works but then gets in a right old muddle! Will hopefully puzzle this out tomorrow.

Once I have sorted the movement out, I'll post up latest WIP.
Havie is offline  
Old 13 November 2020, 23:20   #30
Toki
Registered User
 
Toki's Avatar
 
Join Date: Feb 2016
Location: Birmingham
Age: 60
Posts: 107
Thanks for the up date. Sounds like you are making good progress. I'm looking forward to the WIP!
Toki is offline  
Old 14 November 2020, 01:53   #31
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,215
scrolling - you could use the hardware scroll for 16 pixels, then reset to 0 offset and use BlockScroll to shift everything down 16 pixels in one go. It's fast but only works on whole 16 px chunks. But a combination of that plus bit plane scrolling should be a nice compromise between a massive bitmap and lots of blitting
E-Penguin is offline  
Old 14 November 2020, 09:26   #32
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Quote:
Originally Posted by E-Penguin View Post
scrolling - you could use the hardware scroll for 16 pixels, then reset to 0 offset and use BlockScroll to shift everything down 16 pixels in one go. It's fast but only works on whole 16 px chunks. But a combination of that plus bit plane scrolling should be a nice compromise between a massive bitmap and lots of blitting
Quite possibly but as I am trying to recreate the original arcade feel so I only blit 1 invader per frame, your ship, shot, alien shots (3) and ufo so not many blits at all. Also, I am only using one screen and doing straight blits with a black border so they erase as they move. Probably quickest way to do blitting.

Couple with on 2 bitplanes I think this should be plenty fast enough?
Havie is offline  
Old 14 November 2020, 11:04   #33
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
I should add - it's my dodgy code/logic that's the problem with invader's movement not Blitz!
Havie is offline  
Old 15 November 2020, 21:03   #34
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Finally sorted out the movement code - all to do with the 1st invader and the last invader!

Here is a second test adf - let me know if it works ok. Keys are joystick or zx and shift. Add a few sounds to make it a bit more interesting.

http://eab.abime.net/zone/test.adf

Last edited by Havie; 15 November 2020 at 22:12. Reason: Didn't have BB file in in adf so re:upoladed and changed link.
Havie is offline  
Old 17 November 2020, 00:24   #35
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Done a bit more on this:

Added scoring.
Added lives and made screen look even more like arcade.
If all Invaders shot then you get a new wave.
If Invaders land then game restarts.

http://eab.abime.net/zone/test.adf

BB Code included - needs more comments!

To do:
Invaders shoot back
UFO
Player 2?
High Score
Intro Screen?

Does seem to like A500 though - think it may be how my adf works?
Havie is offline  
Old 17 November 2020, 15:20   #36
Toki
Registered User
 
Toki's Avatar
 
Join Date: Feb 2016
Location: Birmingham
Age: 60
Posts: 107
This is really cool. Thanks for including the BB code, it's going to help me understand how the code works. A really good insight. Thanks for providing the comments in the code as well. You've set yourself some real challenges here, and you are meeting them brilliantly. I love the sound of the shots, and the movement of the Invaders is perfect.
Toki is offline  
Old 17 November 2020, 15:57   #37
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Thanks - I only intended to see show it worked but now am committed to completing the game. Won't be an exact copy as I haven't looked at the same resolution as this would take it over NTSC but will try and make it as similar as possible!

Will keep commenting in code and on thread so hopefully this will help understanding of my thinking - I am definitely not the world's best coder though so I expect others will have better insights.
Havie is offline  
Old 17 November 2020, 23:26   #38
Toki
Registered User
 
Toki's Avatar
 
Join Date: Feb 2016
Location: Birmingham
Age: 60
Posts: 107
Thanks, it will be fascinating to see the code evolve.
Toki is offline  
Old 18 November 2020, 12:15   #39
rothers
Registered User
 
Join Date: Apr 2018
Location: UK
Posts: 490
I wonder how the arcade does the collision detection, I doubt it's testing every invader every frame. I'm thinking it perhaps waits until the bullet collides with a 1 in the video ram and then works out what's closest.

You could even throw in a little lookup table to make that even faster.

It has loads of speed advantages, if the bullet is above the invaders then it has to have hit the UFO, below then it has to have hit the bases etc. it removes loads of checks.

The arcade uses an 8080 chip so I'd assume they did some interesting optimization.

Last edited by rothers; 18 November 2020 at 12:21.
rothers is offline  
Old 18 November 2020, 13:30   #40
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,215
Are your shots sprites? You can use the hardware sprite/bob collision to identify whether there's been a hit - you know the location of the sprite at that point so look around to see what's near it. You don't need to test against every alien/base.
E-Penguin is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
A500 Space Invaders MB revision rossb support.Hardware 20 22 October 2019 20:45
SPACE INVADERS samples? volvo_0ne request.Modules 5 28 February 2018 22:16
Pit Fighter / Super Space Invaders! stainy HOL data problems 4 23 May 2008 08:45
[Found: Mr Wobbly Leg Versus The Invaders From Space] Space-Invaders game? Dindel Looking for a game name ? 5 06 March 2008 10:05
Super Space Invaders (WHDLOAD) Retro1234 request.Old Rare Games 3 30 October 2006 20:12

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:38.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09372 seconds with 13 queries