EragonZZZZ
Member
|
quote:
ORIGINAL: ion24 What does taking hours of typing Teach? C/Ping is MUCH faster and it doesn't Fry the nerves in your wrists. Okay, fine. You know what, this post pisses me off beyond anything I've seen online today. Here, I'm going to copy/paste some code for you that I get STRAIGHT from a 'tutorial' site, and you tell me EXACTLY what each line does, mkay? onClipEvent (load) {
yspeed = 0;
xspeed = 0;
wind = 0.00;
power = 0.65;
gravity = 0.1;
upconstant = 0.75;
friction = 0.99;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
xspeed = xspeed-power;
}
if (Key.isDown(Key.RIGHT)) {
xspeed = xspeed+power;
}
if (Key.isDown(Key.UP)) {
yspeed = yspeed-power*upconstant;
}
if (Key.isDown(Key.DOWN)) {
yspeed = yspeed+power*upconstant;
}
xspeed = (xspeed+wind)*friction;
yspeed = yspeed+gravity;
_y = _y+yspeed;
_x = _x+xspeed;
_rotation = _rotation+xspeed;
if (_root.wall.hitTest(_x, _y, true)) {
xspeed = 0;
yspeed = 0;
_x = 50;
_y = 50;
}
if (_root.environment.hitTest(_x, _y, true)) {
xspeed = 0;
yspeed = 0;
_x = 50;
_y = 50;
}
} Ooh, I'm sure we've all learned a lot from staring at that code.
|