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!
when gf clicked forever if <touching [wall v]> move [-5] steps
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!
when gf clicked forever if <touching [wall v]> move [-5] steps
What I'm needing help with is so that it bounces, but still has gravity and falls to the ground.
Offline
when gf clicked set [xv v] to (0) set [yv v] to (0) forever if <key [right arrow v] pressed?> change [xv v] by (1) end if <key [left arrow v] pressed?> change [xv v] by (-1) end if <touching [wall v]?> set [xv v] to ((xv) * (-1)) end set [xv v] to ((xv) * (0.87))And do the same with yv except put a:
change [yv v] by (-1)in the forever loop.
Last edited by chanmanpartyman (2012-03-31 22:37:44)
Offline
chanmanpartyman wrote:
when gf clicked set [xv v] to (0) set [yv v] to (0) forever if <key [right arrow v] pressed?> change [xv v] by (1) end if <key [left arrow v] pressed?> change [xv v] by (-1) end if <touching [wall v]?> set [xv v] to ((xv) * (-1)) end set [xv v] to ((xv) * (0.87))And do the same with yv except put a:change [yv v] by (-1)in the forever loop.
But it's not moving!
Offline
Mokat wrote:
But it's not moving!
Stick this in the x-script:
change x by (xv)and this in the y-script:
change y by (yv)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!
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:
change x by (xv)and this in the y-script:change y by (yv)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!
and of course, you have to put both of those scripts in a forever sign.
like this:
when gf clicked forever change y by (yv) change x by (xv) [/scratchblocks
Last edited by AgentRoop (2012-04-01 21:00:52)
Offline