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 / Respawn object if stuck

Author
Message
Cyborg ART
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 13th Mar 2010 14:30
Hi!

I am having a problem with my game. I have several balls falling down (Dark Physics powered) from the "sky", but sometimes these balls get stuck on the obstacles.

Now I want these to respawn at the top, but I cant really get it to work.

I ahev this code:


I am thankfull for all help

mike5424
17
Years of Service
User Offline
Joined: 30th Mar 2009
Location:
Posted: 13th Mar 2010 18:06
Uh, This code does nothing, It just makes a variable with the position.

Anyway, If your using a array to check if they exist and if they don't create them then it's fairly simple, Just delete them if there stuck...

---
Silvester
20
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 13th Mar 2010 18:17 Edited at: 13th Mar 2010 18:17
You could always add a timer to check for how long an object has been stuck(On the same location, or maybe height from the ground) for, and if it's been stuck for more then a set period of time respawn it?


EDP Map Editor[2D]
Cyborg ART
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 13th Mar 2010 18:44
Quote: "Uh, This code does nothing, It just makes a variable with the position."


This code is within a loop, so its meant to get the object position, and if the object position is the same next loop then it should respawn.

But it doesnt work...

Quote: "You could always add a timer to check for how long an object has been stuck(On the same location, or maybe height from the ground) for, and if it's been stuck for more then a set period of time respawn it?"


The problem is that I dont know how to make timers, or to check if the object is stuck

janbo
17
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 13th Mar 2010 19:43
Do something like this

Login to post a reply

Server time is: 2026-07-26 21:11:47
Your offset time is: 2026-07-26 21:11:47