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.

AppGameKit Classic Chat / Problem with 2D Kinematic physics collision

Author
Message
fubarpk
Retired Moderator
15
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 14th Jan 2019 07:47
Problem with 2D Kinematic physics collision
I have this function to check contacts


which is called from an array like this


and the enemies are set up like this


Now the bullets work and bounce off the planes but the collisions are returning values just spr1 is never equal to spr2 in the check contact
fubar
fubarpk
Retired Moderator
15
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 14th Jan 2019 07:48
full source no media required

fubar
puzzler2018
User Banned
Posted: 14th Jan 2019 12:28
Can't wait to test this out latet
fubarpk
Retired Moderator
15
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 14th Jan 2019 14:20 Edited at: 14th Jan 2019 19:09
Thanks puzzler just wish I could get the collision routine working ?

My understanding is
that static objects you cant move once set to static
dynamic objects you have to use the physics move commands to move
and kinematic you can set the object positions after the physics set


Ok I think I have to set the objects to dynamic and use SetSpritePhysicsImpulse
which means I have to delete physics when I want to reset them because they've
gone too far off the screen.

This is what ive got with impulse


Ok so theyre a bit fast but all in time lol
fubar
puzzler2018
User Banned
Posted: 14th Jan 2019 21:04
This looks a cool little project too - did you manage the physics stuff or still not working as you want it

Nice work, dont forget Stunt car racer like me with Lemmings LOL
blink0k
Moderator
7
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Jan 2019 22:03
kinematic objects will ignore static objects and only collide with dynamic objects
fubarpk
Retired Moderator
15
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 14th Jan 2019 22:03
think ive got the physics worked out now just have to work the speed settings
still not sure why the kinematic didn't work
fubar
fubarpk
Retired Moderator
15
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 15th Jan 2019 05:21 Edited at: 15th Jan 2019 06:25
Quote: "kinematic objects will ignore static objects and only collide with dynamic objects"

thanks didn't know that, the planes I tried as kinematic and the bullets shooting them dynamic but that didn't detect a collision
altho the bullets were detecting collisions with other bullets and the kinematic planes they were bouncing off etc but wouldn't
return a collision. I seem to have issues with collisions often ohwell I got it making the planes dynamic and kinda a color change
and fade for an explosion as im trying to keep it with all media created by code.

Ok so I got collisions working nicely now just to make a game out of it
fubar
puzzler2018
User Banned
Posted: 15th Jan 2019 07:38
Well achieved. Look forward to having a go at the game
fubarpk
Retired Moderator
15
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 15th Jan 2019 17:17
The classic game BlitzKrieg brought back to life (no media required)
Ok so theres no levels just one game where you play until you run out of ammo or die so still needs levels
fubar
puzzler2018
User Banned
Posted: 15th Jan 2019 17:50 Edited at: 15th Jan 2019 17:50
very well done and cool app - but a bit frantic for first level. Love the way you rotate the gun and the maths to do the particiles.

Awsome

Login to post a reply

Server time is: 2020-08-12 19:44:11
Your offset time is: 2020-08-12 19:44:11