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 / Sprite Physics Collisions Help

Author
Message
BitManip
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Essex
Posted: 28th Jul 2018 17:06 Edited at: 28th Jul 2018 17:34
[SOLVED]

Hi All,

Been away quite a while and thought I would come back to AppGameKit, starting with a simple brick breaker game to get savvy once again.

The bat, ball and bricks are physics sprites and collisions occur between them all (ball hits and bounces as it should).

However, although the collisions are occurring, GetPhysicsCollision(Ball, Bricks[x,y]) correctly detects there has been a collision, yet GetPhysicsCollision(Ball, Bat) does not register the collision?

See some code below:



I have tried changing sprite groups to no avail.

Feeling kinda dumb here, so any help much appreciated!
I control all the juicy in here!
puzzler2018
User Banned
Posted: 28th Jul 2018 17:19
Could it be that the SetSpritePhysicsOn as 2 for the ball and 3 for the bat maybe? try set them the same
BitManip
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Essex
Posted: 28th Jul 2018 17:23
Puzzler

Did that and it has no positive result (only that the ball now changes the bat's rotation)

What I do not get is that the collisions and working correctly, the ball bounces off the bat. However, GetPhysicsCollisions(Plr, Bat) is not triggered???
I control all the juicy in here!
BitManip
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Essex
Posted: 28th Jul 2018 17:35
[SOLVED]

Has to put the collision detection before the Bat Movement code.

DOH!


Thanks anyhow!
I control all the juicy in here!

Login to post a reply

Server time is: 2024-11-23 17:48:51
Your offset time is: 2024-11-23 17:48:51