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.

Newcomers DBPro Corner / First Game collision help(I think....)

Author
Message
Jozers
19
Years of Service
User Offline
Joined: 19th Nov 2004
Location: If I knew I would tell you!!
Posted: 20th Dec 2004 03:30
Hi,
I am having problems with my first game. The idear is that you(a sphere) travel around a landscape a collects smaller spheres. However i thought i would test the collision detect which then deletes the small sphere(I only have one sphere as this is just a test). But whenever then two spheres collide there is an error, DB says its an error on the last line but this just has loop on it. I can't seem work out what the problems is.
HERE IS THE CODE


I'm sorry if I have made a stupid mistake and i am wasting your time. However i am a n00b. oh, i'm using DBC by the way.

I also thought it would be cool if the spheres exploded when they were touched. I have had a look at particle bombs in the intergrated help section, but i found this quit comfusing(well what can you expect i am a total n00b ), is there a different way of doing this, or could some explain in detail how the particle bomb thing works or is this to complicated for a n00b!
Cookyzue
20
Years of Service
User Offline
Joined: 12th Oct 2003
Location: Who Cares?!
Posted: 20th Dec 2004 05:47 Edited at: 20th Dec 2004 05:52
Your haveing the error because when they collide the sphere(object 2) is being deleted and since you still have position object 2 in your code it messes up because the object doesnt exist anymore, i am assuming.Use this.



Hope i helped.

edit: where it syas if object exist(2) then position object 2,500,0,100, you dont need that, you could just put it as position object 2,500,0,100 right after you make object 2.


Current Project: Goonder Mania
MCK Games
Clackersmith
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location:
Posted: 20th Dec 2004 05:54 Edited at: 20th Dec 2004 05:55
well from just a qwick glance-- You are still trying to position a Object that might not exist. When object 1 hits object 2 you are deleating object 2 then on line 32 you are trying to position obejct 2 but object 2 has been deleted when object 1 collided with it. Going with the hole deleting of object 2 thing I would go

If Object exist(2)
Position object 2,500,0,100
endif

You seam to be trying to position object 2 randomly anyway befor the loop so puting the Position object 2,500,0,100 command in the loop would be stoping it from randomly positioning the object. Just try removing the command all together. I hope this makes sence to you I sort of been up for like 50 somthing hours now so I cant even see my computer screen proberly. Im of to bed but tomorow ill come back and check on how it is going and have a better look at you code.


[edit] You relly need to be qwick around here...Year what he seed
Jozers
19
Years of Service
User Offline
Joined: 19th Nov 2004
Location: If I knew I would tell you!!
Posted: 20th Dec 2004 20:22
Thanks for that, it now works how it should. I just deleted the line with position object 2,etc, now I need to make it more of a game some I thought it would be a good idea to add some more balls(i have used a FOR,NEXT statement). This, however is when i ran into yet another problem. I will try a work out what is wrong, but I will post the code in case someone spots the problem before me.


I have also added fog and changed the backdrop color. Does anyone know how I could get a more interesting backdrop? I will check to DB examples section in a minute. Oh yeah, another problem i had with my code was the big sphere didn't seem to texture, but I will have a better look a what I have programmed. I am also still interested in have the spheres explode when you touch them using a particle bomb effect. However I know nothing about particle bombs/effects. Could someone explain how they work.

Thanks Again
Jozers
Jozers
19
Years of Service
User Offline
Joined: 19th Nov 2004
Location: If I knew I would tell you!!
Posted: 22nd Dec 2004 00:07 Edited at: 23rd Dec 2004 21:33
Still Having trouble with my code!!!

[Edit]Please someone help I've been trying for days my code still isn't working I think it is something to do with the line IF object collision(1,x)=1 then delete object x because when ever I change the x to 2 it deletes object 2 when you collide with one of the small spheres.

please, I really need the help
Jozers
19
Years of Service
User Offline
Joined: 19th Nov 2004
Location: If I knew I would tell you!!
Posted: 24th Dec 2004 23:13 Edited at: 24th Dec 2004 23:20
I've been looking though the codebase, other forums, the tutorials and the DB manual and found some people using the IF object collision(_,_) code but havn't put Set object colision to ___ so I tried my code without it.



This seems to be a slight improvement as now instead of just going straight through the small spheres the computer actually detects the collision but it then comes up with an error about something not existing(like before).Please could somebody just how a look at my code and just tell my if i was right to delete the 'set object collision to _____'. By the why all the media for my code is in the DB media browser.

[EDIT] Sorry should have used the edit button
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 24th Dec 2004 23:20
Well i also have posted a game on this forum were you collecting small boxes


It needs no media and you can find it here (Fell free to use the code in you game )

Here is the link : http://forum.thegamecreators.com/?m=forum_view&t=43655&b=6




Hope it helped


The Nerd

wanna join Waggames?
then visit our site at : http://www.freewebs.com/waggames
my old forum name was: The Nerd
Jozers
19
Years of Service
User Offline
Joined: 19th Nov 2004
Location: If I knew I would tell you!!
Posted: 8th Jan 2005 03:33
Thanks, but it was wrote in DBP and I'm using DBC. If you put the code in DBC every thing is ok apart from the collision doesn't work so it's really no good. But thanks anyway

Login to post a reply

Server time is: 2024-09-23 08:27:22
Your offset time is: 2024-09-23 08:27:22