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.

Dark GDK / 2d sprite to 3d object collision, 2d sprite animation, 2d circle collisions

Author
Message
xbruceleex
14
Years of Service
User Offline
Joined: 16th Feb 2010
Location:
Posted: 4th Mar 2010 12:58
my first question is:

is it possible to make 2d to 3d collisions with the darkgdk or do i have to write the function by myself?

my second question is:

how do i make 2d circle collisions? i can only use square collisions right now.

my third question is:

i have loaded an image with sprite animations.to be specific it's an image of an explosion animation. i want that animation to play only once. so far i use a counter to count how many times the dbPlaySprite function is used but it doesn't really work the way i wanted it to work. i think the problem is the delay part in the playsprite function.
Pilz X Schizo
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Massachusetts, USA
Posted: 6th Mar 2010 20:55
i found this for circle collision, it is in visual basic but it may help. http://www.rookscape.com/vbgaming/tutAP.php . basicly your checking the distance between 2 points in 2d and then you use that with the radius of each point your checking to determine if they are colliding.

this may not work but trying to get you in the right direction.
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 6th Mar 2010 21:31
To play the animation only once, try the dbSpriteFrame command to check which frame of the animation is displayed at the moment. If it reaches the last frame (or when it loops back to the first frame, to make sure that the last frame is also displayed for enough time), you can stop the animation.

There is no collision between 2d and 3d objects so you need to implement your own solution there.
xbruceleex
14
Years of Service
User Offline
Joined: 16th Feb 2010
Location:
Posted: 7th Mar 2010 22:17
with your help i managed to solve my problem. now i have new questions:

1. i managed my collision between 2d and 3d object by creating an invisible sprite over my 3d object. so whenever i movy my 3d object the 2d object would move in the same direction and is always at the center. my question is: can do it the other way around? i want to move my 2d object and my 3d object will follow that 2d object and would always be at the center.

2. i want to create a homing missile



i used this to calculate the angle between my homing missile and the target.



with this code my homing missile can only be fired if my target is on the left side of my playership. if my target is on the right side my missile would turn to 90° after that to 270° after that to 90° again and so on while going down slowly.
i want my homing missile to work correctly.

Login to post a reply

Server time is: 2024-10-02 01:32:19
Your offset time is: 2024-10-02 01:32:19