The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.39 / 5.00 38,635 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 15,161 ViewsI am currently in the process of making my first game, and I have very little knowledge of Action Script. The game I'm designing is an overhead (top-down) shoot-em-up. I was doing fine for a while, until I encountered a problem; I couldn't figure out how to make the character stop when he runs into a wall. I pored over numerous tutorials on NG for at least a couple of hours, but most tutorials didn't have anything to do with what I needed, and the most relevant tuts had broken scripts that I had no idea how to fix. Could somebody please help me figure out how to do this, or tell me where to find a tutorial that does work?
Thanks for your help, and be on the lookout for my game on teh portal when I finish it!
When Buddha held up a piece of bacon, Kasyapa smiled.
Check out AS: Main in my sig, I know I've seen tuts in there.
AS: Main
Don't read this sentence.
ok here goes...this should help but check AS:Main too.
Setting Variables
walkspeed=10;
So I'm assuming you wrote the code for the character to move?
This code is for the character hitting a wall to the left
while(this.hitTest(_root.wall._x, _root.wall._y, true))
{_x+=walkspeed+5;
walkspeed=walkspeed+0;
gotoAndStop(2);
}
So while your character is hitting the wall it will go in the other direction by more then its normal speed(so when its hits the wall..it gets knock back a little). Then the walkspeed gets set back to normal. And it goes to the frame of the character looking right(optional).
Hopes this helps!
:'(