Hi everyone, back after quite some time away so getting my soggy brain matter working again.... or not as the case may be!
Problem with Sprite Physics Impulse... A simple matter of applying a Physics Impulse to my spaceman sprite!
My sprite has it's offset set to its centre. There is no Gravity or Restitution and the sprite shape is set to Polygon. The sprite is stationary in the centre of the screen using VirtualResolution.
Using the Left Cursor key (37) I apply and impulse directly from the 'Right' of the sprite using GetSpriteXByOffset and adding a value for the impulse point X and using the GetSpriteYByOffset for the impulse point Y. For the Vector coords I simply use the GetSpriteXByOffSet and the GetSpritYByOffset values to aim the impulse to the centre of the sprite.
Seems logical to me... However the sprite spins clockwise and moves from left to right and down then screen slightly... instead of directly right to left???
Here is the code I have used:
start_spaceman:
SetSpritePositionByOffset(100,870,540)
SetSpriteShape(100, 3 )
SetSpritePhysicsOn(100,2)
SetSpritePhysicsCanRotate(100,1)
SetSpritePhysicsRestitution(100,1)
SetSpritePhysicsFriction(100, 0 )
SetSpritePhysicsMass( 100, 800)
Return
check_spaceman_keys:
If GetRawKeyState ( 37 ) = 1 REM - LEFT
SetSpritePhysicsImpulse(100, GetSpriteXByOffset(100) + 100 ,GetSpriteYByOffset(100),GetSpriteXByOffset(100),GetSpriteYByOffset(100))
Endif
Any help would save my sanity right now, many thanks