View Full Version : Alias-like shooting engine
SNOWmanx
April 19th, 2006, 11:44 AM
Hello. I'm trying to make a game when I encountered a problem. I have no clue as to how I could do the shooting. The type I'm going for is an Alias-type shooting engine, like
http://www.goriya.com/flash/alias.shtml
Thanks.
Skinny_T
April 19th, 2006, 12:43 PM
:lol: I thought that was your game! That rocked! Err...back to topic. There are several examples of platformers on this site and a few shooting examples from memory. From what I can figure of that game they use _xmouse and _ymouse to aim and then its an animation with a hit test and the movieclip gets rotated to the mouse angle. The knockback is clever in that game aswell.
SNOWmanx
April 19th, 2006, 01:00 PM
In english that means...
just joking.
So then basically, I get a movieclip with a shot animation getting longer and longer. Then I while it to see if the animation collides with an object, correct? If the shot fails to hit at that legnth, I do a nextFrame() on the shot animation, correct?
Joppe
April 19th, 2006, 01:37 PM
Hey if you search the forums you will find lots of threads, i remember one exactly like this one but with answers ;)
SNOWmanx
April 19th, 2006, 02:46 PM
Great... just what should I search fer?
Joppe
April 19th, 2006, 02:48 PM
Alias-
Platform game-
Platform shooting game-
Platform shooting-
Try your way forward :)
SNOWmanx
April 19th, 2006, 04:00 PM
Thanks for trying, but apparantly no answers are to be found. I'll just stick with classic moving bullets until somebody could give me a way to do this simply.
Joppe
April 19th, 2006, 04:34 PM
http://www.kirupa.com/forum/showthread.php?t=90914&highlight=alias
What did you actually search for?
SNOWmanx
April 19th, 2006, 04:37 PM
everything on that list. That one page doesn't seem to be helping...
Joppe
April 19th, 2006, 05:24 PM
[qoute=Lomadrian]
var bullet:Object = {counter:0, speed:10};
gun_mc.onMouseMove = function():Void {
updateAfterEvent();
var x:Number = _root._xmouse - this._x;
var y:Number = _root._ymouse - this._y;
var angle:Number = Math.atan2(y, x) * 180/Math.PI;
this._rotation = angle;
};
gun_mc.onMouseDown = function():Void {
bullet.counter++;
if (bullet.counter>100) { bullet.counter = 1; }
var name:String = "bullet_"+bullet.counter;
var point:Object = {x:this.tip._x, y:this.tip._y};
this.localToGlobal(point);
var bullet_mc:MovieClip = _root.attachMovie("bullet", name, bullet.counter, {_x:point.x, _y:point.y});
var angle:Number = this._rotation * Math.PI/180;
bullet_mc.xmov = Math.cos(angle)*bullet.speed;
bullet_mc.ymov = Math.sin(angle)*bullet.speed;
bullet_mc.onEnterFrame = function():Void {
this._x += this.xmov;
this._y += this.ymov;
if (this._x<0 || this._y<0 || this._x>Stage.width || this._y>Stage.height) {
this.removeMovieClip();
}
};
};
Mouse.addListener(gun_mc);
[/quote]
So that does not help at all?
SNOWmanx
April 19th, 2006, 06:03 PM
I already knew that, sorry for being vague. I wanted something that fires instantly like they way they do, not travelling bullets. Unless you're in the Matrix, you won't be able to see a bullet.
Stratification
April 19th, 2006, 06:12 PM
You might be able to adapt the collision detection script that Kirupa put up in the experiments section:
http://www.kirupa.com/forum/showthread.php?t=194573
SNOWmanx
April 19th, 2006, 08:01 PM
Wow, that's a cool script. Of course I'm going to adapt that... only if it won't lag if there's probably 15 different instances of that at the same time. Why? Think: Battlefront. :smirk: Thanks to everyone who helped me out. If anybody has a lite version of something that can do this, I'd appreciate it!
KIERIOSHIMOTO
April 23rd, 2006, 09:34 AM
http://n99creations.com/?pID=tutorials&col=Blue&tut=create_platform_game&p=1&l=Flash_MX_04
Nathan99's website. This platformer tutorial will help you create a simpler but similar game if you alter it.
SNOWmanx
April 23rd, 2006, 01:32 PM
I already have an engine, and that engine in my opinion isn't too good. Also, to avoid confusion it isn't a platformer, more of a top-down shooter.
KIERIOSHIMOTO
April 23rd, 2006, 09:24 PM
i see but you linked to a platformer and said "like this" so i assumed...
SNOWmanx
April 23rd, 2006, 10:00 PM
Yes, sorry for the confusion :sigh:
KIERIOSHIMOTO
April 23rd, 2006, 10:24 PM
it's ok+ that tutorial i linked you too is for basics its too help people learn so you cant just say that it aint any good.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.