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 / collision problems....

Author
Message
malospam
12
Years of Service
User Offline
Joined: 27th Aug 2011
Location: Florida
Posted: 4th Oct 2011 21:06
I was wondering if anyone else has this issue, I posted a while back but I got no answer. I was building a volleyball like game. The problem is, is that AppGameKit doesn't "register" all the collisions. I set the physics on for the ball and the player. Now everytime the ball hits the player it does bounce, but it doesn't always register. for example I use the code " if getspritecollision(ball,player1)" and then I have a sound play or some text print. The problem is, only sometimes the sound plays or the text prints, so only sometimes does the getspritecollision=true, even though AppGameKit is having the ball react by bouncing off of him, but I can't get AppGameKit to do everything after the if statement, because it only registers the collision sometimes and it seems mostly random. Can anyone please offer advice on this? Thanks!

maker of iphone/ipad games
MobileCreator
12
Years of Service
User Offline
Joined: 1st Jun 2011
Location: Ottawa - Canada
Posted: 5th Oct 2011 04:04
Hey,

because of your question, I was looking at http://www.appgamekit.com/documentation/Reference/Sprite/GetSpriteCollision.htm and there it says "This command is primarily for sprites that are not using physics" and at the end "This function only operates on the sprite's base shape. Any additional shapes added to physics sprites will not be used in this function, use GetPhysicsCollision instead."

So I believe since you are using physics, probably you have to use the GetPhysicsCollision instead.

I'm actually doing something similar and I'm not using collision. Can you share you've done setting up the physics ? Maybe we leverage our knowledge (or lack of if ) about this matter.


Regards!

----------
Paulo
http://www.mobilecreators.com
malospam
12
Years of Service
User Offline
Joined: 27th Aug 2011
Location: Florida
Posted: 5th Oct 2011 18:54
Hey MobileCreator I wasn't even aware of that function, thanks alot. Right now what works perfectly is simply subtracting the x and y values to see how close the player is to the ball, and if its close, I simply change the velocity of the ball with the appropriate direction. What are you working on?

maker of iphone/ipad games
malospam
12
Years of Service
User Offline
Joined: 27th Aug 2011
Location: Florida
Posted: 5th Oct 2011 19:26
Thanks MobileCreator that function worked perfectly!

maker of iphone/ipad games

Login to post a reply

Server time is: 2024-04-24 08:39:21
Your offset time is: 2024-04-24 08:39:21