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 Discussion / Using FOR

Author
Message
Seeker123
22
Years of Service
User Offline
Joined: 25th Apr 2003
Location:
Posted: 3rd May 2003 01:53
I need a little help with using FOR. I need to use it so the number can detect which objects are colliding and deletes the collided objects. When I used it, the only way I could delete all of the objects in the program was to hit them in order. Can anyone please help me?
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd May 2003 02:31
Post your current code, someone will know how to correct it.

Thanks in advance.
All the Best,
StevieVee
Chiwawa
22
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 3rd May 2003 02:51
something like that...



p.s.
i did not tested it..i writed it on the forum in less than 30 secondes...then....if there is error..
Seeker123
22
Years of Service
User Offline
Joined: 25th Apr 2003
Location:
Posted: 3rd May 2003 03:40
Here is what I was using. Why does the program only let me delete the objects in order?

Thanks to whoever helps me.
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 3rd May 2003 04:59
Do you understand what a FOR loop does?

If not, here goes:
Start at a given number being assigned to a counter variable, increment the variable by 1 each time the loop completes, do whatever is inside the loop until the loop completes.

What exactly are you trying to do? What should happen instead of deleting objects in the order they are encountered in the FOR loop (provided that a collision happens)? Tell us in detail the scenario in the game...
Seeker123
22
Years of Service
User Offline
Joined: 25th Apr 2003
Location:
Posted: 3rd May 2003 06:19
I would like for the player to shoot an object and when the object hits on of the enemies then enemy should be deleted. I would like it to be any enemy can be deleted instead of having to delete them in order.
AsriCE
22
Years of Service
User Offline
Joined: 10th Jan 2003
Location: Brunei
Posted: 3rd May 2003 11:03
Try turning the fire# flag to zero(i.e fire#=0) after deleting the object.



Asri CE Crew

Anak Brunei!
Seeker123
22
Years of Service
User Offline
Joined: 25th Apr 2003
Location:
Posted: 3rd May 2003 15:54
That still does not fix the problem of deleting them in order. I have also tried not using the for and it still does the same thing.

Can anyone please help me?

Login to post a reply

Server time is: 2025-05-17 07:29:12
Your offset time is: 2025-05-17 07:29:12