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 / A question about collisions

Author
Message
mnemonic
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 10th Apr 2013 18:35 Edited at: 10th Apr 2013 19:54


When I run the code the play object command is run when enemyColl = 0 thou it should'nt. I know this because the enemy is moving left until he falls over the edge of the world. At this moment enemyColl = 0 and he moves down. Should'nt enemyColl always be true as long as something crosses the ray casted by the sc_SphereCastGroup command?

The enemy moves over a heightmap terrain which is set up with sc_SetupComplexObject

BEST!

www.memblockgames.com
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 10th Apr 2013 21:09
its probably still playing from the last collision, rather than being an issue with the collision checking. add a 'stop object' command next to your move object down

mnemonic
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 10th Apr 2013 21:17
You are probably right. But since I try to move the object, and animate it at the same time during the collision and that is not working, the object moves but without nimation there might be something wrong with the maatrix multiplications here.
I'll try to rem either the movement or the animation command next time when i find the time

www.memblockgames.com
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 10th Apr 2013 21:21
try loop object instead of play, it may be resetting to the first frame each collision, or add a check for if object playing =0 then play object

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 10th Apr 2013 22:31 Edited at: 10th Apr 2013 22:32
Whether it's play or loop animation, if enemyColl <> 0 then the animation will be reset and not play anyway. Change it to this..



I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
mnemonic
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden
Posted: 11th Apr 2013 09:01
I changed play object, to loop object, and then a stop object when enemyColl = 0, and that worked.

Why it did not work with playobject I do not know. Maybe there is a significant difference between play- and loop object? Anyone knows this?

www.memblockgames.com
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 11th Apr 2013 10:09
play is designed to just play through once from start to finish and so it will restart every call.

loop is designed to play continuously until stopped. Calling it again doesn't reset the frames, it just continues playing/looping.

Login to post a reply

Server time is: 2026-07-07 02:40:11
Your offset time is: 2026-07-07 02:40:11