Could someone help me get it so that the sprite will bounce off of solid walls and also bounce off the mouse pointer? No, I am not making a platformer, but I'm making a "bounce maze" where you bounce the bubble off the mouse pointer and the bubble pops when it's touching the wall. I want it to bounce off and have a sort of "gravity" so that it will fall to the ground unless you bounce it back up. Help would be appreciated
Last edited by Mokat (2012-03-31 21:32:17)
Offline
Mokat wrote:
Could someone help me get it so that the sprite will bounce off of solid walls and also bounce off the mouse pointer? No, I am not making a platformer, but I'm making a "bounce maze" where you bounce the bubble off the mouse pointer and the bubble pops when it's touching the wall. Help would be appreciated
![]()
Try this for an example!
whenclicked
forever iftouchingwall ▼move-5steps
Offline
SilverDomination wrote:
Mokat wrote:
Could someone help me get it so that the sprite will bounce off of solid walls and also bounce off the mouse pointer? No, I am not making a platformer, but I'm making a "bounce maze" where you bounce the bubble off the mouse pointer and the bubble pops when it's touching the wall. Help would be appreciated
![]()
Try this for an example!
whenclicked
forever iftouchingwall ▼move-5steps
What I'm needing help with is so that it bounces, but still has gravity and falls to the ground.
Offline
And do the same with yv except put a:whenclicked
setxv ▼to0setyv ▼to0foreverifkeyright arrow ▼pressed?changexv ▼by1ifkeyleft arrow ▼pressed?changexv ▼by-1iftouchingwall ▼?setxv ▼toxv*-1setxv ▼toxv*0.87
in the forever loop.changeyv ▼by-1
Last edited by chanmanpartyman (2012-03-31 22:37:44)
Offline
chanmanpartyman wrote:
And do the same with yv except put a:whenclicked
setxv ▼to0setyv ▼to0foreverifkeyright arrow ▼pressed?changexv ▼by1ifkeyleft arrow ▼pressed?changexv ▼by-1iftouchingwall ▼?setxv ▼toxv*-1setxv ▼toxv*0.87in the forever loop.changeyv ▼by-1
But it's not moving!
Offline
Mokat wrote:
But it's not moving!
Stick this in the x-script:
and this in the y-script:change x byxv
Additionally, I find it better to put both the x and y velocity script in the same loop, but if this works for you, great!change y byyv
Offline
That worked! Thanks
(p.s. This is me from my test account)
Offline
MoreGamesNow wrote:
Mokat wrote:
But it's not moving!
Stick this in the x-script:
and this in the y-script:change x byxvAdditionally, I find it better to put both the x and y velocity script in the same loop, but if this works for you, great!change y byyv
and of course, you have to put both of those scripts in a forever sign.
like this:
whenclicked
foreverchange y byyvchange x byxv
Last edited by AgentRoop (2012-04-01 21:00:52)
Offline