Author Topic: Space Invaders  (Read 5047 times)

0 Members and 1 Guest are viewing this topic.

Offline Colonel_Panic

  • Newbie
  • Posts: 54
    • View Profile
Space Invaders
« on: November 07, 2021, 08:27:16 pm »
pretty sure "CLOCK" was my first "graphics program".
I wanted to see if I could do a retro video game.

SPACE INVADERS
 
NOTES:
linux has sound issues (for me) so, no sound
press ENTER when it starts; I forgot I would ever deploy it.
Z and X are left and right, SPACEbar to fire
I'm on LINUX MINT? and... it's a little faster than the original.

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Space Invaders
« Reply #1 on: November 07, 2021, 09:17:19 pm »
I too use Linux Mint. The extra-long for...next loop in "again1:" can be replaced by the _limit command. Try _limit 60 or Limit 120

I do not have any sound issues with my machine including QB64. Check out the _SNDOPEN() and _SNDPLAY() commands. (useful for 'wav' or 'ogg' files). I am not familiar with QB64's play command.

Destroyed the two aliens. Ignored the UFO. UFO disappeared.
A few moments later the following error message.

Line 301 (in main module)
Subscript out of range

J
Logic is the beginning of wisdom.

Offline Colonel_Panic

  • Newbie
  • Posts: 54
    • View Profile
Re: Space Invaders
« Reply #2 on: November 07, 2021, 11:17:22 pm »
I just went and played 3 screens worth.... fine.

line 301, I checked "my" code here that I just deployed from
then
I went in and checked the ZIP folder I deployed from...
THAT line 301, in the BAS file? its the same there...

line 301:
    aliens_at = aliens_at + alien_d

Offline Colonel_Panic

  • Newbie
  • Posts: 54
    • View Profile
Re: Space Invaders
« Reply #3 on: November 07, 2021, 11:21:29 pm »
did you try compiling the BAS file?
(remember to use *EXE in the folder option)

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Space Invaders
« Reply #4 on: November 08, 2021, 07:24:17 am »
Compile each time. EXE is created in the qb64 folder.
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Space Invaders
« Reply #5 on: November 08, 2021, 08:58:33 am »
I am getting subscript out of range on line 320:
Code: QB64: [Select]
  1.  If bugs(l_alien, t) <> 0 Then l_chk = 0: GoTo check_done:    
  2.  

It seems to do with shooting because when I continue anyway, every time I shoot the error message repeats.
 
Subscrip out of range.PNG


Definitely a different space invaders than Pete's and others I've seen with advancing horde going back and forth making it's way down screen.

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Space Invaders
« Reply #6 on: November 09, 2021, 07:38:13 am »
Not a solution to the "subscript" error... But couldn't the "goto check_done", in line 320, be replaced with an "exit for"?... and similar for line 300?

Even though, for me anyway, the demo runs 'very' quickly, I am impressed that the images are actually 'drawn" and not sprites. So cool...
Logic is the beginning of wisdom.