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 / AGK2 ball physics

Author
Message
Ashes
8
Years of Service
User Offline
Joined: 25th Dec 2015
Location:
Posted: 1st Jan 2016 19:45
Hi guys, I'm new to AppGameKit and i'm trying to make something like an air hockey game using agk's physics system.

I am first setting up the ball and cant get it to start at a desired velocity. I have used SetSpritePhysicsVelocity ( ball.sprite,200,800) and it seems to have the same effect with SetSpritePhysicsVelocity ( ball.sprite,20000,80000). Shouldn't the ball move faster in the second case? What am I doing wrong?

I removed friction, set restitutuion to 1 and damping to 0, still my ball would only move this fast.

I can accelerate it by constantly applying a force but I dont want to do that.

I have attached the project files. Help me please
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 2nd Jan 2016 03:03
Try reducing the physics scale (SetPhysicsScale). I believe the default is 0.20, I normally go for 0.05... This should give you a little more force to play with...
Using AppGameKit V2 Tier 1
Ashes
8
Years of Service
User Offline
Joined: 25th Dec 2015
Location:
Posted: 4th Jan 2016 03:32
Thanks, it works like that, now I have to find out why collisions are not pixel perfect .
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 4th Jan 2016 08:20
One idea with the collision accuracy issue - try making a sprite that is a solid, single colour version of your sprite, and using that when setting up the sprite physics. It might be that there's too much alpha blending around the edges, and using a solid sprite gives AppGameKit a better chance of making an accurate shape for it.
Ashes
8
Years of Service
User Offline
Joined: 25th Dec 2015
Location:
Posted: 10th Jan 2016 02:20
Van B, I will try that, I am currently testing features and moved to a different project.

Login to post a reply

Server time is: 2024-04-19 19:28:28
Your offset time is: 2024-04-19 19:28:28