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 / making an object

Author
Message
hpfan273
18
Years of Service
User Offline
Joined: 19th Jan 2007
Location:
Posted: 1st Apr 2007 10:59
i am using DBC... and every time i collect all 4 yellow dots, it says... "object allready exists"... and i have searched up and down my code... and i am totally clueless as to y... can any body help me? here is my code:


I have attatched everything in my folder for this game... including my saved editor file... thank you for your time

Why do they turn against me? Especially when i need them the most?

Attachments

Login to view attachments
Quisco DaLuse
18
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: USA
Posted: 1st Apr 2007 15:48
One small change is all you need:



Just check to see if object exist(21)=0.

You idiots! You've captured their stunt doubles!
hpfan273
18
Years of Service
User Offline
Joined: 19th Jan 2007
Location:
Posted: 1st Apr 2007 18:08
omg... i would have nvr thought of that... thank you... lol

Why do they turn against me? Especially when i need them the most?
hpfan273
18
Years of Service
User Offline
Joined: 19th Jan 2007
Location:
Posted: 1st Apr 2007 19:35
it's doin' it again... exept now when i hit one of my objects in level 3... here is the code:

the same media is used for this one...

Why do they turn against me? Especially when i need them the most?
Gil Galvanti
20
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 1st Apr 2007 22:10
what line?


Quisco DaLuse
18
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: USA
Posted: 1st Apr 2007 22:24 Edited at: 1st Apr 2007 22:26
In your level 3 setup, you used object #32. Object #32 was also used for the 'bonus ball' to end level 2. The program is confused when object 32 is collided with and the program tries to jump to the next level and create objects that are already in place.

I would suggest revamping your code and putting in some arrays to handle the data instead of having so many lines of code to display each level. I also would use an array for the objects that will be used in each level, and just re-use the same ones (it will vary depending on the number of objects needed, of course). I would organize your objects, so that certain ones in sequential order are used to make platforms, certain ones are the balls to capture, etc. You could use the same object as the bonus ball in each level if you wanted. This way, when you go to check collision, you can have one loop to handle it and you won't have to piece-meal it. It would make for neater code and would be easier to debug.

I would also suggest that you use a variable to count the number of balls needed to capture to complete each level. That way, if you decide to put in a bonus score of some sort, it would not affect your code's ability to know when the level is complete.

You idiots! You've captured their stunt doubles!

Login to post a reply

Server time is: 2025-05-27 19:01:52
Your offset time is: 2025-05-27 19:01:52