Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Space invaders help

Author
Message
Rikukarasuma
15
Years of Service
User Offline
Joined: 15th May 2011
Location: Ireland
Posted: 12th Jul 2011 17:57
Can anyone tell me whats wrong with this code

Its only the bomb code of the invaders project, you see as soon as I compile the code the repeat|until keeps repeating and wont start the game until the condition from which I have set is false. I had a working version once although strange it contradicted itself but somehow worked and now I had to strip away this code and fix it properly because the old code kept conflicting with the second level I was trying to create :/
Here is the rest of the project. Ps it is not the final build so there might be repeats of code.
Space Invaders 1.1

Functions

Space


And also in case anyone is wondering why I keep asking questions in this forum about space invaders is because I had made a space invaders game but it was over 2000 lines of code and it did not have arrays in it, I wanted to repeat the project so I could learn about arrays and how i could use them.
Thanks to anyone who even has the patience to look over this

Yello http://www.youtube.com/user/Rikukarasuma?feature=mhee
SJPro
23
Years of Service
User Offline
Joined: 3rd Jul 2003
Location:
Posted: 13th Jul 2011 16:12
I've not tried the code, but if you are talking about this



then if Alien(0,0).Dead =1 when you enter the loop it run the x= and y= code once.

If Alien(0,0).Dead =0 when you enter the loop it will continually give x and y a random value and never exit.

I'm wondering whether you condition value of on the loop should be Alien(x,y).Dead=1?

www.freewarehub.net
Rikukarasuma
15
Years of Service
User Offline
Joined: 15th May 2011
Location: Ireland
Posted: 13th Jul 2011 16:50
Thanks but even so Alien(x,z).Dead = 1 still i get the same result when I compile :/ the screens just black

Yello http://www.youtube.com/user/Rikukarasuma?feature=mhee
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Jul 2011 17:25
How would it ever escape the repeat/until loops? Your code doesn't change the values of anything other than X and Z inside those loops. Are you sure you have those in the right place?
SJPro
23
Years of Service
User Offline
Joined: 3rd Jul 2003
Location:
Posted: 13th Jul 2011 17:47
Quote: "Thanks but even so Alien(x,z).Dead = 1 still i get the same result when I compile :/ the screens just black"


That means none of the aliens have their dead variable set to one. I'm assuming this is a function to pick a random alien and testing to see if it is alive? Maybe setting =0 is the check needed. Without bothering to check all your code I won't be able to tell. As mentioned above you need to consider what event you want to cause the exit of the loop.

www.freewarehub.net

Login to post a reply

Server time is: 2026-07-11 02:36:48
Your offset time is: 2026-07-11 02:36:48