Welcome!!!

Take a look and be amazed!

Friday, April 30, 2010

Programming is a completely different language

I got my movements and area defined out for my game. The only thing i have left to do now is keep trying to find the proper coding for internal walls. The walls i have made on the outside and they can work on the inside, but in one direction, the character wont go through it and from the other side, he can go right through it. so im trying to figure out a way to make a line completely impenetrable from any angle. IF there are any suggestions, please feel free to leave me a comment or two or give me some examples of some wall coding that works because i am stumped and cannot find any codes that work with my codes.

onClipEvent (load) {
yspeed = 2 ;
xspeed = 0;
power = 2;
friction = .8;
//gravity = 0.009; }

onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT))
{ xspeed += power;
this.gotoAndStop("right");
} if (Key.isDown(Key.LEFT))
{ xspeed -= power;
this.gotoAndStop("left");
} if (Key.isDown(Key.UP))
{ yspeed -= power;
this.gotoAndStop("up");
} if (Key.isDown(Key.DOWN))
{ yspeed += power;
this.gotoAndStop("down");}
_rotation += xspeed;
_y += yspeed;
_x += xspeed;
xspeed *= friction;
yspeed *= friction;
//yspeed += gravity;
if (_root.ball, hitTest(_root.wall4))
{ this._x += 10;
this.gotoAndStop("right");}
if (_root.ball, hitTest(_root.wall3)) {
this._y -= 10;
this.gotoAndStop("up");}
if (_root.ball, hitTest(_root.wall1)) {
this._x -= 10;
this.gotoAndStop("left");}
if (_root.ball, hitTest(_root.wall2)) {
this._y +=10;
this.gotoAndStop("down");}}



1 comment:

  1. Andrew, awesome job on your game presentation today keep working on your walls and your game will be sweet.

    ReplyDelete