i have a scrolling background problem...
i'm not sure how to make sure the character doesn't walk through buildings... he can hit the object at any angle and moving him won't stop the background from moving.. please help!
Last edited by Rpgking (2009-12-20 08:34:49)
Offline
Okay, I'm not a big scraATCHER, But If there's one thing I know, It's scrolling. There should be a script in the stage that says, like, If left arrow key clicked, then some stuff, and also a script that says If right arrow key clicked (these scripts may be joined together, It really dosen't matter). Make your character sprite not be able to do his walking movement if he is touching a certain color (the color of the buildings). Good luck!
Offline
CharlieAZ wrote:
Okay, I'm not a big scraATCHER, But If there's one thing I know, It's scrolling. There should be a script in the stage that says, like, If left arrow key clicked, then some stuff, and also a script that says If right arrow key clicked (these scripts may be joined together, It really dosen't matter). Make your character sprite not be able to do his walking movement if he is touching a certain color (the color of the buildings). Good luck!
yes, but if he touches something and all movement is disabled.. then how will he move away from the wall? :S
Offline
Heres the script to make:
If (color) touching (wall) xvelocity = xvelocity - xvelocity x 2 End if
And soon and soforth.
which means that, if his right side color, is touching the wall, he'll bounce bacwards, just as if you ran into a wall,
To every action, there is an equal opposite reaction
since the wall won't move, the player will.
Offline
thanks, cds56
your way didn't work for me, however your way did help me work it out.. i just tweaked it a bit..
ok.. now i'm back on track.. it's far from finished but i can now focus on other things
thanks again
Offline
cds56 wrote:
Heres the script to make:
Code:
If (color) touching (wall) xvelocity = xvelocity - xvelocity x 2 End ifAnd soon and soforth.
which means that, if his right side color, is touching the wall, he'll bounce bacwards, just as if you ran into a wall,To every action, there is an equal opposite reaction
since the wall won't move, the player will.
It would be easier to do Xvel * -1
Offline