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 / Physics Impulse vx,vy towards a sprite

Author
Message
haliop_New
User Banned
Posted: 9th Apr 2016 21:13
SetSpritePhysicsImpulse(stick.id,GetSpriteXByOffset(stick.id),GetSpriteYByOffset(stick.id),0,250)

I kinda forgot the code
on how to lauch a sprite with physics impulse according to the sprites angle

thank you for your time
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 10th Apr 2016 09:48 Edited at: 10th Apr 2016 09:49
u can put the sprite angle in to sin / cos for vx and vy
a# = GetSpriteAngle( iSpriteIndex )
= Cos( a# ) * factor
= Sin( a# ) * factor
AGK (Steam) V2.0.18 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
haliop_New
User Banned
Posted: 10th Apr 2016 13:33
thank you , I actually just remembered what to do .
thank you.

Login to post a reply

Server time is: 2024-09-29 13:22:12
Your offset time is: 2024-09-29 13:22:12