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 AppGameKit Corner / Can a '2-d sprite airplane' be detected colliding with a '3d building ?

Author
Message
Bubba
Reviewed AGK on Steam
12
Years of Service
User Offline
Joined: 10th Jul 2005
Location: California, US
Posted: 9th Mar 2018 21:32 Edited at: 10th Mar 2018 08:19
I have a 2D 'sprite' airplane flying through a 3d world. It flies through 3d buildings without crashing. In order to make it more realistic I would like it to explode when it Hits a building instead of flying 'through' the buildings. But I don't know how I could detect the crash, is it possible? .

Attachments

Login to view attachments
GarBenjamin
1
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 9th Mar 2018 21:43
Need some prep work but a simple overlapping rectangles function should work.


TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
puzzler2018
User Offline
Joined: 8th Oct 2017
Location:
Posted: 9th Mar 2018 21:54
Per pixel collision i think - Phealax done a perfect one - have a look

https://forum.thegamecreators.com/thread/219444

wish could help but 2d is not my thing anymore
puzzler2018
User Offline
Joined: 8th Oct 2017
Location:
Posted: 9th Mar 2018 22:06 Edited at: 9th Mar 2018 22:11
Stop confusing me - 2d in a 3d world lol. errmmmm hows that possible??

You cant... create a 3D airplane and use ObjectRayCast

would love to see a video of what you have so far for a 2D sprite in 3D world - bet it will look odd
blink0k
AGK Developer
5
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 9th Mar 2018 23:20
If you made a flat mesh the shape of your 2D sprite and then used the 2D image as a texture i think it would work
hoyoyo80
2
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 10th Mar 2018 04:53
Plane with alpha textures work. But animating it will be another story.
blink0k
AGK Developer
5
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 10th Mar 2018 07:33
You could load it as an object then and use the 3D collision commands. I'm not sure i understand what the problem with animating it is?
smallg
Valued Member
12
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 11th Mar 2018 09:46
Why not just use the 3d raycast in the direction the plane is going? You can convert the planes 2d co-ords to 3d easily enough.
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu

Login to post a reply

Server time is: 2018-06-25 13:16:36
Your offset time is: 2018-06-25 13:16:36