View Full Version : Enemie
Svea
February 5th, 2009, 06:22 AM
Hi..
we are making a flash game and we want "enemies" to spawn above the game window and jump down from like a higher building or from treetops
any idea how to make that?
BeerOclock
February 5th, 2009, 09:05 AM
can someone make a game for me too?
dandylion13
February 5th, 2009, 02:18 PM
Hi Svea,
Thanks for your post, but it's a little too general for most people here to comment on helpfully. If you can try and break some of your problems down into detailed specifics, we can surely help :)
First of all, you need to know Flash and AS3.0. If you haven't already done so, have a look at some of these books:
Flash CS4 for Designers
Learning ActionScript 3.0
Essential ActionScript 3.0
ActionScript 3.0 Animation
... and, although it's advanced, it will help with your game design problem: ActionScript 3.0 Game Programming University.
Otherwise, many top-notch programmer on this forum will be able to make this game for you for a fair market rate if you're in a hurry.
Good luck!
Svea
February 6th, 2009, 06:31 AM
yeah i guess its abit general.
i just started a new course on flash so im not that good at it.
i will look into some of those books.
its not that i want help with the whole game that would be a waste then i wont learn anything.
i just a have a problem to start making my enemies move :P
thnx for reply
BeerOclock
February 6th, 2009, 12:59 PM
enemie.x += 10;
that should move him!
dandylion13
February 6th, 2009, 02:48 PM
yeah i guess its abit general.
i just started a new course on flash so im not that good at it.
i will look into some of those books.
its not that i want help with the whole game that would be a waste then i wont learn anything.
i just a have a problem to start making my enemies move :P
thnx for reply
No problem :)
Svea
February 9th, 2009, 07:27 AM
if (timer == 15) {
timer = 0;
pirate2Array.push(new pirate(Math.random()*20, 420));
addChild(pirate2Array[pirate2Array.length-1]);
sound.startSound("yar");
}
for (var i:int = 0; i<pirate2Array.length; i++) {
pirate2Array[i].Update(player);
if (pirate2Array[i].y > 500 || pirate2Array[i].hp <=0) {
removeChild(pirate2Array[i]);
pirate2Array.splice(i,1);
}
}
i got this in my main class
and i got another class called pirate
package{
import flash.display.MovieClip;
public class pirate extends MovieClip{
public var speed:Number;
public var hp:int = 10;
public function pirate(setX:Number, setY:Number){
speed = Math.random()*8+2
x = setX;
y = setY;
}
public function Update(player){
if(player.x - x < 80){
}else{
x +=speed;
}
}
}
}
this is my pirate code..
i got a "pirate" that i want to use one frame from my movie clip and
another frame when the "pirate" is near my player
}
public function Update(player){
if(player.x - x < 80){
// i figured that i want the second frame here but i cant seem to get a hold how to make it i tried using gotoAndStop.
but then i get a error that have something to to with static
i dunno what i made wrong. i dont know how to make it more specific
}else{
if anyone understand im thank full for any awnser.
ayumilove
February 9th, 2009, 08:39 AM
you might want to use the [ as ] [ /as ] tags 'without the spaces between the brackets' for your code.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.