I have been searching around the forums for examples of using the % System for filling the entire screen.
Here is what I have found.
rem Landscape App
SetDisplayAspect(-1)
//Set Physics Variabls
SetPhysicsGravity(0, 150)
W# = 100 * GetDeviceWidth()/1200
H# = 100 * GetDeviceHeight()/800
spr = CreateSprite(0)
LoadImage (spr, "apple.png")
SetSpriteSize (spr, W#/20, H#/20*2.5)
SetSpritePosition ( spr, 5, 5 )
SetSPritePhysicsOn(spr,2)
Ground = CreateSprite(0)
SetSpriteSize(Ground,100,5)
SetSpritePosition(Ground,0,95)
SetSpritePhysicsOn(Ground,1)
do
If GetPointerPressed()
SetSpritePhysicsVelocity(spr,GetSpritePhysicsVelocityX(spr),-75)
endif
Sync()
loop
My question is...Why is the physics not working correctly?
If you test the code you will see the Sprite falls to the ground, and is 1 pixel off from touching the ground when it stops.
Been trying to figure this problem out for awhile now
Any advice will be very much appreciated
Edit: Problem solved...I don't know why I was using
SetPhysicsScale
Although when I removed the scale, it still does not fully touch the ground sprite. It is very close...but still no touch down. Any ideas?
I mean it is close enough too not really matter imo, but is this as good as it gets?
I adjusted the code above with no Physics Scale, If you test it you will see what I am talking about.
Beta Test Age of Knights:https://play.google.com/apps/testing/com.CrazyProgrammerProductions.my_AgeOfKnights
Download JellyFish Dive:https://play.google.com/store/apps/details?id=com.CrazyProgrammerProductions.my_JellyFishSwim