I just came up with the greatest way to shoot in a Flash game ever. I'm pretty sure I'm not the first guy to come up with this.
What I've bin doin so far is; I've bin makin the game produce a bullet whenever you click that flies across the screen. Like in CannonCrotch, you see a bullet, you see it moving, and you see it hit an enemy or wall.
Contra does this, Metal Slug, Alien Hominid, tonnes o games.
In reality, bullets aren't that slow. Bullets are fuckin quick.
So what I've done is, I've pre-determined every position the bullet would ever be in, then produced a hundred bullets that each occupy one of those positions. FUCKIN TIMEWARP.
Observe:
http://spamtheweb.com/ul/upload/060908 /7441_YeahBabyGoYeah_Allright.php
Click to shoot. Use WASD to move around.
Here's the chode:
onClipEvent (mouseDown) {
hit = false;
for (i=1; i<=30; i++) {
if (!hit) {
duplicateMovieClip(_root.shot, "shot"+i, i);
xshot = (i*20)*(Math.cos(R*(Math.PI/180)));
yshot = (i*20)*(Math.sin(R*(Math.PI/180)));
_root["shot"+i]._x = _x+xshot;
_root["shot"+i]._y = _y-40+yshot;
if (_root.ground.hitTest(_root["shot"+i].
_x, _root["shot"+i]._y, true)) {
hit = true;
_root["shot"+i].removeMovieClip()
}
}
}
}
The-Red-Jack
Awesome...
*bookmarks*