Space Invaders Problem
Doing a project in flash at the minute in Space Invaders but don't really know too much about flash mx. The problem I have is that when i shoot the attackers from my ship they're not blowing up and I don't know how the code to do this .My code at the minute for shooting is
onClipEvent(load){
moveSpeed=10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x+=moveSpeed;
} else if (Key.isDown(Key.LEFT)) {
this._x-=moveSpeed;
}
}
// when the mouse cliks
onClipEvent(mouseDown)
{
// duplicate the bullet mc
_root.bullet.duplicateMovieClip("bullet" + bulletNum,bulletNum);
// set the coords to the mouse clik
eval("_root.bullet" + bulletNum)._x = this._x;
eval("_root.bullet" + bulletNum)._y = this._y;
// increment the bullet number
bulletNum++;
// if more than 50 bullets , start again at 0
if(bulletNum>50)
bulletNum = 0;
}
and for the attacker is
onClipEvent(load){
this._y =0;
speed=10;
}
onClipEvent(enterFrame){
if(this._x <0)
{
// set direction to right
speed=10;
// drop down
this._y +=30;
}
if(this._x > Stage.width)
{
// set direction to left
speed=-10;
// drop down
this._y += 30;
}
// move horizontal
this._x += speed;
}
If anyone could help me with some of the code I would much appreciate it
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 03-07-2005, 04:42 PM
View Complete Forum Thread with Replies
Sponsored Links:
Space Invaders
I've been working on this game just to learn the basics og Flash scripting, but I fail to grasp why some of my asteroids suddenly become invulnerable, even my spaceship becomes vulnerable. Not always, but sometimes.
My apologies for...ineffective coding.
View Replies !
View Related
Space Invaders
I am having trouble with a space invaders game, instead of increasing the lives of the defender (who you control) I want to give the enemies at the top of the screen more lives, at the minute I have it so there is only one enemy at the top (this is after a row of enemies you defeat) and I would like to give this one enemy about 10 lives. Is this even possible?
I need help as soon as possible, if anybody knows how to give an enemy in space invaders more lives (preferably on the movieclip itself) I need help on the actionscript I need to put up there. At the minute it is something like this:
// Set a certain amount of life:
this.bosslives = 10;
// If the bullet touches the Bug:
if (this.bullet.hitTest(this)) {
// Decrement the bosslives:
this.bosslives -= 1;
// Stop at the beginning of the movie:
this.gotoAndStop(1);
}
// If the life is or less than 0:
if (this.bosslives <= 0) {
// Go to and Stop at frame 9:
this.removeMovieClip;
this.gotoAndStop(9);
}
But I know this is completely wrong, any ideas?
View Replies !
View Related
Space Invaders
Has anyone created a space invaders game in flash mx. If you have I would love to take a look at it. Doing college project and just want to see the outcome. Maybe pinch a few ideas
View Replies !
View Related
Space Invaders Fla
hey everyone,
I was wondering if anyone had a good space invaders fla file they were willing to share with everyone. I wanted one so I could modify it with my own graphics and put it on my site, with a mention to the creator of course. Any takers?? Thanks Guys!
View Replies !
View Related
Space Invaders
Has anyone created a space invaders game in flash mx. If you have I would love to take a look at it. Doing college project and just want to see the outcome. Maybe pinch a few ideas
View Replies !
View Related
Another Space Invaders Deal
This is probably quite simplistic for the most of you, but here goes:
It's the usual space invaders type deal, the spaceship scolls x, the enemies coming down from various random y coorinates. There's a scoreboard (it's var being scoreBoard,
instance name being theScore).
The initial value of the variable score is 0, of course, thus incremented by 200 with each enemy killed. What I'd like to know is this: I want to start an entirely new level when the score reaches----let's just say 5000,
for instance---How do I go about doing this? I've tried various 'if' statements, but I can't seem to get it to work.
Also, the variable score, the scoreboard, that is, is within a dynamic text box. Any help at all would truly be appreciated!
View Replies !
View Related
Space Invaders Tutorial
Anyone know a site with a real good making a space invaders game from scratch tutorial? I have tried looking at various sourcecodes, but I find I am not learning as much as I want to if I just take someone elses code and edit it a bit.
View Replies !
View Related
Help With My Space Invaders Game
I recently startd making a space invaders game and have ran into some problems... the ship at the bottom shoots and the monster at the top moves but im not very good with collison detection and i want the monster to disapear or blow up when he is shot....... also i would like to have a game over when one of the aliens hits the bottom of the screen or shoots you ... i inclosed the .fla file at the bottom
thanx for ur help
View Replies !
View Related
Recoding Space Invaders
There is a space invaders .fla available on flashkit in the tutorials at this address:
http://www.flashkit.com/movies/Games...7230/index.php
I want to recode it so I can reduce the number of ailens that appear in the lines of aliens but I can't find the code that controls this, can anyone help me here?
Cheers
Howie
View Replies !
View Related
Space Invaders Shooting...
Hey everyone, I have reviewed various tutorials, but can't seem to find any that falls under my issue. My problem is that I have created a space invaders game and was wondering how I would make the bullet shoot, and go off the screen...and also be able to shoot multiple bullets....
If anyone has any tutorials to recommend or advice please let me know...
Thanks
View Replies !
View Related
Space-Invaders-Shield ?
Hi
Been wondering about the general logic of making a spaceinvader game shield thingy... The lid thingy that the ship at the bottom hides behind while the aliens rain bombs down.
Now some of these just remain there, and don't do much. But the ones I'm thinking of disapear "bit by bit" as they are hit by the aliens bombs.
I could make each lid out of say 50 small block clips and hitTest these... but there must be a better less cpu intensive way surely, because the game already is running shed loads of hitTests from the bombs the aliens drop, to the lasers the ship fires.
Any ideas anyone please?
View Replies !
View Related
Space Invaders Question
has anyone here ever worked on a space invaders type of game? The part I'm having difficulty with is figuring out an approach to writing a function to determine which enemy ships will drop their bombs and when, also as you wipe out the bottom rows, the upper rows should begin dropping their bombs instead. If anyone has done this before I'd appreciate any suggestions, thanks.
View Replies !
View Related
Space Invaders To Quiz?
Right then, I've got this (pretty naff) Space Invaders game where you shot down celebrities and the like. I'd like to create a quiz so that when players answer a questions correctly they can shoot the celebs, but if they're wrong the celebs will shot them. How do I write a code that links the correct answer to a part of the game?
I've tried and tried but my AS is probably too basic for this, or am I missing something really obvious?
Anyone?
Yossi
View Replies !
View Related
Space Invaders Problem
Doing a project in flash at the minute in Space Invaders but don't really know too much about flash mx. The problem I have is that when i shoot the attackers from my ship they're not blowing up and I don't know how the code to do this .My code at the minute for shooting is
onClipEvent(load){
moveSpeed=10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x+=moveSpeed;
} else if (Key.isDown(Key.LEFT)) {
this._x-=moveSpeed;
}
}
// when the mouse cliks
onClipEvent(mouseDown)
{
// duplicate the bullet mc
_root.bullet.duplicateMovieClip("bullet" + bulletNum,bulletNum);
// set the coords to the mouse clik
eval("_root.bullet" + bulletNum)._x = this._x;
eval("_root.bullet" + bulletNum)._y = this._y;
// increment the bullet number
bulletNum++;
// if more than 50 bullets , start again at 0
if(bulletNum>50)
bulletNum = 0;
}
and for the attacker is
onClipEvent(load){
this._y =0;
speed=10;
}
onClipEvent(enterFrame){
if(this._x <0)
{
// set direction to right
speed=10;
// drop down
this._y +=30;
}
if(this._x > Stage.width)
{
// set direction to left
speed=-10;
// drop down
this._y += 30;
}
// move horizontal
this._x += speed;
}
If anyone could help me with some of the code I would much appreciate it
View Replies !
View Related
Space Invaders Problem
Doing a project in flash at the minute in Space Invaders but don't really know too much about flash mx. The problem I have is that when i shoot the attackers from my ship they're not blowing up and I don't know how the code to do this .My code at the minute for shooting is
onClipEvent(load){
moveSpeed=10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x+=moveSpeed;
} else if (Key.isDown(Key.LEFT)) {
this._x-=moveSpeed;
}
}
// when the mouse cliks
onClipEvent(mouseDown)
{
// duplicate the bullet mc
_root.bullet.duplicateMovieClip("bullet" + bulletNum,bulletNum);
// set the coords to the mouse clik
eval("_root.bullet" + bulletNum)._x = this._x;
eval("_root.bullet" + bulletNum)._y = this._y;
// increment the bullet number
bulletNum++;
// if more than 50 bullets , start again at 0
if(bulletNum>50)
bulletNum = 0;
}
and for the attacker is
onClipEvent(load){
this._y =0;
speed=10;
}
onClipEvent(enterFrame){
if(this._x <0)
{
// set direction to right
speed=10;
// drop down
this._y +=30;
}
if(this._x > Stage.width)
{
// set direction to left
speed=-10;
// drop down
this._y += 30;
}
// move horizontal
this._x += speed;
}
If anyone could help me with some of the code I would much appreciate it
View Replies !
View Related
Space Invaders Problem
Space Invaders problem
Doing a project in flash at the minute in Space Invaders but don't really know too much about flash mx. The problem I have is that when i shoot the attackers from my ship they're not blowing up and I don't know how the code to do this .My code at the minute for shooting is
onClipEvent(load){
moveSpeed=10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x+=moveSpeed;
} else if (Key.isDown(Key.LEFT)) {
this._x-=moveSpeed;
}
}
// when the mouse cliks
onClipEvent(mouseDown)
{
// duplicate the bullet mc
_root.bullet.duplicateMovieClip("bullet" + bulletNum,bulletNum);
// set the coords to the mouse clik
eval("_root.bullet" + bulletNum)._x = this._x;
eval("_root.bullet" + bulletNum)._y = this._y;
// increment the bullet number
bulletNum++;
// if more than 50 bullets , start again at 0
if(bulletNum>50)
bulletNum = 0;
}
and for the attacker is
onClipEvent(load){
this._y =0;
speed=10;
}
onClipEvent(enterFrame){
if(this._x <0)
{
// set direction to right
speed=10;
// drop down
this._y +=30;
}
if(this._x > Stage.width)
{
// set direction to left
speed=-10;
// drop down
this._y += 30;
}
// move horizontal
this._x += speed;
}
If anyone could help me with some of the code I would much appreciate it
View Replies !
View Related
Space Invaders To Quiz?
Right then, I've got this (pretty naff) Space Invaders game where you shot down celebrities and the like. I'd like to create a quiz so that when players answer a questions correctly they can shoot the celebs, but if they're wrong the celebs will shot them. How do I write a code that links the correct answer to a part of the game?
I've tried and tried but my AS is probably too basic for this, or am I missing something really obvious?
Anyone?
Yossi
View Replies !
View Related
Space Invaders Problem
Doing a project in flash at the minute in Space Invaders but don't really know too much about flash mx. The problem I have is that when i shoot the attackers from my ship they're not blowing up and I don't know how the code to do this .My code at the minute for shooting is
onClipEvent(load){
moveSpeed=10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x+=moveSpeed;
} else if (Key.isDown(Key.LEFT)) {
this._x-=moveSpeed;
}
}
// when the mouse cliks
onClipEvent(mouseDown)
{
// duplicate the bullet mc
_root.bullet.duplicateMovieClip("bullet" + bulletNum,bulletNum);
// set the coords to the mouse clik
eval("_root.bullet" + bulletNum)._x = this._x;
eval("_root.bullet" + bulletNum)._y = this._y;
// increment the bullet number
bulletNum++;
// if more than 50 bullets , start again at 0
if(bulletNum>50)
bulletNum = 0;
}
and for the attacker is
onClipEvent(load){
this._y =0;
speed=10;
}
onClipEvent(enterFrame){
if(this._x <0)
{
// set direction to right
speed=10;
// drop down
this._y +=30;
}
if(this._x > Stage.width)
{
// set direction to left
speed=-10;
// drop down
this._y += 30;
}
// move horizontal
this._x += speed;
}
If anyone could help me with some of the code I would much appreciate it
View Replies !
View Related
Space Invaders Problem
Space Invaders problem
Doing a project in flash at the minute in Space Invaders but don't really know too much about flash mx. The problem I have is that when i shoot the attackers from my ship they're not blowing up and I don't know how the code to do this .My code at the minute for shooting is
onClipEvent(load){
moveSpeed=10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x+=moveSpeed;
} else if (Key.isDown(Key.LEFT)) {
this._x-=moveSpeed;
}
}
// when the mouse cliks
onClipEvent(mouseDown)
{
// duplicate the bullet mc
_root.bullet.duplicateMovieClip("bullet" + bulletNum,bulletNum);
// set the coords to the mouse clik
eval("_root.bullet" + bulletNum)._x = this._x;
eval("_root.bullet" + bulletNum)._y = this._y;
// increment the bullet number
bulletNum++;
// if more than 50 bullets , start again at 0
if(bulletNum>50)
bulletNum = 0;
}
and for the attacker is
onClipEvent(load){
this._y =0;
speed=10;
}
onClipEvent(enterFrame){
if(this._x <0)
{
// set direction to right
speed=10;
// drop down
this._y +=30;
}
if(this._x > Stage.width)
{
// set direction to left
speed=-10;
// drop down
this._y += 30;
}
// move horizontal
this._x += speed;
}
If anyone could help me with some of the code I would much appreciate it
View Replies !
View Related
Isometric Space Invaders Game- Z Loc?
howdy.
i'm new to actionscript, having worked only with director lingo. i made a flash copy of the zx spectrum game 'manic miner' which is on the main frame of http://www.todayguide.com
now i want to make something a bit more ambitious, isometric space invaders, but i'm already finding actionscript a touch constraining after lingo.
i want to know if there is an actionscript comand which mirrors the lingo locz property, which would effectively override the loc z of layers, or perhaps of clips on the same layer (as you can do manually in authoring with 'arrange.')
if not i shall have to make all the invaders move 'virtually' and the have individual mc's change which invader they represent in order to reflect changes in depth.
which will be rather arduous and may lead me to not bothering at all!
all help much appreciated.
View Replies !
View Related
Space Invaders End Of Level Boss
Hi
I'm done a space invaders clone and l like to extend the gameplay by adding a end of level boss each time you complete the level. Anyway l was hoping to implement this, but how can l?
l can upload the fla file privately, but l need some help badly
View Replies !
View Related
[CS3] Space Invaders Hit Test Problem
Hi im having problems with my Hittest function
What I want to do is this:
When "lazer" hits "b4"
- b4 goes to frame 20
- the lazer goes to its defult position which i set earlyer as:
Code:
lazerdefaulty = 80;
lazerdefaultx = -50;
- lazer speed sets from 15 to 0
- lazer switch (to stop you shooting whilst a lazer is live) turns back to 0 allowing you to shoot
NOTE THIS IS THE CODE AND IS WITHIN onEnterFrame
Code:
if (_root.lazer, hitTest(_root.formation.b4)) {
_root.formation.b4.gotoAndPlay(20);
_root.lazer._y = lazerdefaulty;
_root.lazer._x = lazerdefaultx;
_root.lazerspeed = 0;
_root.lazerswitch = 0;
}
Thanks
Full Code Below if needed:
Code:
//Initial Stats
lives = 3;
score = 0;
////////////////////////////////////////////////////////////
//Gun Varables
gunminx = 60;
gunmaxx = 895.9;
gunspeed = 10;
defaultgunx = 90;
defaultguny = 630;
////////////////////////////////////////////////////////////
//Formation Varables
formationminx = 60;
formationmaxx = 210;
formationspeed = 5;
////////////////////////////////////////////////////////////
//Lazer Varables
lazerspeed = 0;
lazerminy = 60;
lazerdefaulty = 80;
lazerdefaultx = -50;
lazerswitch = 0;
////////////////////////////////////////////////////////////
//When you enter the frame
onEnterFrame = function () {
////////////////////////////////////////////////////////////
//Movement Left/Right on Gun
if (Key.isDown(Key.RIGHT)) {
lazergun._x = lazergun._x+gunspeed;
}
if (Key.isDown(Key.LEFT)) {
lazergun._x = lazergun._x-gunspeed;
}
////////////////////////////////////////////////////////////
//Control Shoot
if (Key.isDown(Key.SPACE) && lazerswitch ==0) {
lazerswitch = 1;
lazer._x = lazergun._x+44;
lazer._y = lazergun._y;
lazerspeed = 15;
}
////////////////////////////////////////////////////////////
//Lazer auto movement
lazer._y = lazer._y-lazerspeed;
////////////////////////////////////////////////////////////
//Lazer Reset to position "-50(x),80(y)", switch reset to "0" & lazer speed reset to "0"
if (lazer._y<=lazerminy) {
lazer._y = lazerdefaulty;
lazer._x = lazerdefaultx;
lazerspeed = 0;
lazerswitch = 0;
}
////////////////////////////////////////////////////////////
//Guns min & max constraints
if (lazergun._x<=gunminx) {
lazergun._x = gunminx;
}
if (lazergun._x>=gunmaxx) {
lazergun._x = gunmaxx;
}
////////////////////////////////////////////////////////////
//Formation auto movement
formation._x = formation._x+formationspeed;
////////////////////////////////////////////////////////////
//Formation min & max constraints
if (formation._x<=formationminx) {
formationspeed = formationspeed-formationspeed*2;
}
if (formation._x>=formationmaxx) {
formationspeed = formationspeed-formationspeed*2;
}
////////////////////////////////////////////////////////////
//Lazer Hit Test
if (_root.lazer, hitTest(_root.formation.b4)) {
_root.formation.b4.gotoAndPlay(20);
_root.lazer._y = lazerdefaulty;
_root.lazer._x = lazerdefaultx;
_root.lazerspeed = 0;
_root.lazerswitch = 0;
}
////////////////////////////////////////////////////////////
//Score Updater
_root.myscore = score;
};
View Replies !
View Related
Space Invaders(choosing Direction Of Laser)
i've been creating a space invader's type game however the game i have been training on was a scroller meaningg that it shoot's sideway's can anyone tell me how to make it shoot up? this is the action script for the laser
onClipEvent (load) {
laserMoveSpeed=20;
this._x=_root.spaceship._x+90;
this._y=_root.spaceship._y;
}
onClipEvent (enterFrame) {
this._x+=laserMoveSpeed;
if (this._x>600){
this.removeMovieClip();
}
}
View Replies !
View Related
Controlling Player Fire In Space Invaders
Hi again,
still working through the tutorial on Space Invaders in Flash MX 2004.
I've got the player craft under mouse control. What I don't like about the game is that you can fire as rapidly as you wan't, though the number of bullets is limited. You can change this limit in the variable - I would rather have it though that you can only fire according to a certain interval - say, you can only fire once every second, or half second.
Here is the code at the moment:
// when the mouse cliks
onClipEvent(mouseDown)
{
// duplicate the bullet mc
_root.bullet.duplicateMovieClip("bullet"+bulletNum ,bulletNum);
// set the coords to the mouse clik
eval("_root.bullet" + bulletNum)._x = this._x;
eval("_root.bullet" + bulletNum)._y = this._y;
// increment the bullet number
bulletNum++;
// if more than 50 bullets , start again at 0
if(bulletNum>50)
bulletNum = 0;
}
Anyone have any code I could use for this, or advise on how to alter my own?
regards,
g
View Replies !
View Related
Controlling Fire In Space Invaders Game
Hi again,
still working through the tutorial on Space Invaders in Flash MX 2004 (bit out of date, I know).
I've got the player craft under mouse control. What I don't like about the game is that you can fire as rapidly as you wan't, though the number of bullets is limited. You can change this limit in the variable - I would rather have it though that you can only have a set number of bullets in play at a time (at the moment, if you go over the limit, the uppermost bullets just disapear).
Here is the code:
// when the mouse cliks
onClipEvent(mouseDown)
{
// duplicate the bullet mc
_root.bullet.duplicateMovieClip("bullet"+bulletNum,bulletNum);
// set the coords to the mouse clik
eval("_root.bullet" + bulletNum)._x = this._x;
eval("_root.bullet" + bulletNum)._y = this._y;
// increment the bullet number
bulletNum++;
// if more than 50 bullets , start again at 0
if(bulletNum>50)
bulletNum = 0;
}
What code could I use to have it so that you can only have, say, 3 bullets in play at once, and you can't fire again until they've hit / left the screen?
regards,
g
View Replies !
View Related
Controlling Player Fire In Space Invaders Game
Hi all,
I'm working through an online tutorial on Space Invaders in Flash MX 2004.
I've got the player craft under mouse control. What I don't like about the game is that you can fire as rapidly as you wan't, though the number of bullets is limited. You can change this limit in the variable - I would rather have it though that you can only fire according to a certain interval - a bullet every second, or half second for example.
Here is the code:
// when the mouse cliks
onClipEvent(mouseDown)
{
// duplicate the bullet mc
_root.bullet.duplicateMovieClip("bullet"+bulletNum ,bulletNum);
// set the coords to the mouse clik
eval("_root.bullet" + bulletNum)._x = this._x;
eval("_root.bullet" + bulletNum)._y = this._y;
// increment the bullet number
bulletNum++;
// if more than 50 bullets , start again at 0
if(bulletNum>50)
bulletNum = 0;
}
Anyone have any code that could be used for this, or ideas on how I could modify the above?
regards,
g
View Replies !
View Related
Making My Enemies Drop Bombs In Space Invaders
Hi all,
I'm in the process of learning flash just now and am completing an online tutorial on Space Invaders. Thing is, the bombs drop from a random location on the screen. I want them to drop from a random enemy (I'm not too bothered just now about making it one on the bottom row or one with no other enemies before them).
At the moment, here is the AS that makes them drop (the frequency is determined elsewhere):
eval("_root.alienBomb" + alienBombNum)._x =random(700);
eval("_root.alienBomb" + alienBombNum)._y = 300*Math.random();
An I can modify it to get a certain one to drop:
eval("_root.alienBomb" + alienBombNum)._x =_root.alienClip2_2._x;
eval("_root.alienBomb" + alienBombNum)._y = _root.alienClip2_2._y;
I can' t get it to randomly choose one - I know I have to use the random function, but don't know how to implement this.
Can anyone help?
regards,
g
View Replies !
View Related
Making My Craft Fire In Space Invaders, In MX 2004 - Help Required
Hi all,
I'm working through an online tutorial on space invaders. I've got a MC called "rocketClip" that I want to fire with the mouse click, limiting player fire to once every half second.
I have this piece of (incomplete) code to use on my playerCraft movie clip to get it to fire:
var enableInterval:Number;
var allowFire:Boolean;
function tempDisableFire():Void {
allowFire = false;
enableInterval = setInterval(enableFire, 500); // 500 millisecond delay
};
function enableFire():Void {
allowFire = true;
clearInterval(enableInterval);
};
Though it is incomplete. I think I need to place it inside an "onClipEvent" handler (the event being the mouse click), possibly need to use an "if/else" statement.
It's my first attempt at flash - anyone care to complete this piece of code for me? I don't think it's that far off.
Thanks all,
g
View Replies !
View Related
When Creating Multiple Monsters In Space Invaders, Collision Detection Help
Quick question sirs:
Consider the code below which creates a monster into the stage every 2 seconds, and you firing a bullet every time you click your mouse...
------------------------------------------------------------------------------
var monster:MovieClip;
var bullet:MovieClip;
var monsterMaker:Timer = new Timer (2000, 100);
monsterMaker.addEventListener(TimerEvent.TIMER, addMonster);
monsterMaker.start();
function addMonster(event:TimerEvent):void
{
monster = new Monster();
addChild(monster);
monster.x = Math.random()*stage.stageWidth;
monster.y=0;
}
stage.addEventListener(MouseEvent.MOUSE_DOWN, fireBullet);
function fireBullet(event:MouseEvent):void
{
bullet = new Bullet();
addChild(bullet);
bullet.x = this.mouseX;
bullet.y = this.mouseY;
}
-----------------------------------------------------------------------------------
the monster class has a code which makes the monster move downwards, the bullet class has a code which makes the monster move upward. Assume they work ok
Next thing i want to do is to add collision detection into the bullet and here i have a few questions:
1.) does each of the monsters have a different instance name? or are they all just "monster"'s? and if so..........
2.) if i make a constructor for the Bullet class something like...
var enemy:MovieClip;
function Bullet(target:MovieClip)
{
enemy = target;
this.addEventListener(Event.ENTER_FRAME, moveBullet);
}
//then in the Bullet class, i put a HitTestObject to detect collision...
function moveBullet(event:Event):void
{
this.y -=20;
if (this.hitTestObject(enemy)==true)
//*Inserts a Function That Will Destroy Enemy *
//(something like, this.parent.removeChild(enemy)?)
}
then, in the Main Time Line, everytime i fire a bullet:
function fireBullet(event:MouseEvent):void
{
bullet = new Bullet(monster);
addChild(bullet);
bullet.x = this.mouseX;
bullet.y = this.mouseY;
}
here is my question: there seems to be an error in my logic if there are more than 1 monsters in the stage.. If my bullet hits any one of the monsters, the code will think it has hit all of the monsters and thus destroy all monsters in the stage... Is there some other way to correct this? How will it know which monster was hit by the bullet if each of my monsters are maybe identical to the code?
View Replies !
View Related
"space Invaders" Help Needed
hey everybody...i am making a new design for my site and i had this wonderful idea....the problem is that i dont know how to do it!! the file can be found at http://deadline.phalanxhost.com/alfp...christian2.swf ...and my question is this. how do i make it so that when the ship "shoots" an alien the alien will disappear or explode or something...i want this to be user activated or whatnot so if anybody could help me out that would be great!!! the .fla file is at http://deadline.phalanxhost.com/alfp...christian2.fla if this would help you out anymore...i GREATLY appreciate ANY help i can get!! thanks!
btw...i am somewhat new at actionscript so if you do post help please try to put it into idiot terms so i can understand it
View Replies !
View Related
? How To Translate 3D Space To 2D Space (sort Of) ?
Hi everybody,
I have a question about coordinate systems. I have a 3D space set up (papervision3d), with an array of 20 objects(planes) sitting on the origin (0, 0, 0). What I'd like to do is evenly distribute those 20 objects across the x and y axis so that they appear to be on a 2D plane facing the viewer.
I imagine that some sort of translation needs to be made between the 2D "stage" and the 3D "scene" (dividing the stage width and height). My first idea was to create 4 Arrays of 5 objects each and position those arrays evenly along the y-axis. Next, I was wondering how matrix objects work and if they would have any advantage over arrays here.
Any ideas?? Does this seem like the right direction?
Thanks for your help!
Brian
View Replies !
View Related
See I Got This SPACE.
I got this space... in my suburbia apartment... this place I have of mine. I live with my girlfriend. The space (the whole thing), was ours.. initially. We chose it and moved in to it. WE moved our stuff into this space... put things places... and made choices about where they should go. I chose, she chose... we took turns. This whole space slowly got devided into smaller spaces... or zones. A zone for this and a zone for that. Soon things came.. things that were her stuff... things I bought or put up with, but either way they were hers. These things took up space, and seemlingly had no zone. So soon, these spaces we had devided into zones, became one space again.. hers. She wouldn't agree, but these things that were hers were located in several of the original zones, within the larger space. So now, there are two spaces. The rest of our suburbia apartment and here... were I am talking to you now.. my space.. with my stuff. Odd, this space doesn't exude gravity.. yet these things that I put in the original space.. our now in my space. More and more I find that my things, that were located outside of this space, are satellites in that other space.. the space outside the room. And by the end of a day or week, these satellites seem to find there way back into this space. My things aren't wanted in that space anymore, they are sent here, like so many hunks of floating debri. Mentally, my concern for the whole space has been devided. I now only want for, or am concerned with the state of this space. I move through the other to get to things like coffee, and food.. to travel to the bed space, but I live in this space. I am cleaning it now.. wrought with choices about where to put stuff.. about the zones within it. I move things to new locations in my space. I play my music and watch movies as I change this space.. as I spin round the room piling boxes.. catagorizing things and placing them in new ways to shape my space. She comes in sometimes... but only breifly. To say hi or ask me a question, but she leaves again shortly afterwards. There is only one chair in my space, that chair is for me, it is the tower of observation within my space. In fact everything in this space is designed so this position in space, can access all other spaces easily. In the end, she comes from her space, to see me. She floats like a satellite into my space, on a mission.. breaking briefly from her own atmosphere. In the end she returns, to her space, she spins out of my room. So it's defined. It is here that I am, speaking to you, thinking about being here, being here before, when I replied to a post, when I helped someone or was helped. It was here that I created things I loved, from here that they were shared. It is from here that I will speak to you, and to many of my friends. So to all those out there.. in your spaces, sharing with everyone else in theirs, a toast to space.
Thanks Flashkit!
Paul, Actionscripter
View Replies !
View Related
Need More Space :(
Is there any way to get more workspace than 2880x2880 pixels? It's becoming very annoying as I have several 640x480 pictures that I want to display on one page.
Thanks,
Furry
View Replies !
View Related
Less Space On An SWF
what makes my swf file smaller?
I created a button and i placed it in my library.
If i drag and drop my button onto my stage, what method will be less intensive on my SWF file size:
1. by right clicking on my button while on the stage i choose copy, and then i paste on the stage again, giving me two buttons.
or
2. drag and drop button from my library onto my stage.
ur input is greatly appriciated.
Hector
View Replies !
View Related
Cant Get Rid Of Space Around
http://www.culturecreativellc.com/phenom/phenom4.html
see the space to the right and at the bottom? I want it to be just like the space at the top and the left. heres the HTML code I've used:
<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<title>BIG PHENOM</title>
</head>
<body bgcolor="#000000" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--background="media/pd_bg.gif-->
<table width="850" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="1"><object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="850" height="100%">
<param name=movie value="bigphenom.swf">
<param name=quality value=high>
<param name="menu" value="false">
<embed src="bigphenom.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100%" height="550" menu="false">
</embed>
</object></td>
</tr>
</body>
</html>
Thanx..
View Replies !
View Related
[F8] Space Bar
I'm trying to make it so on the title screen when you press space bar it goes to the 2nd frame of my movie.
i have this code on the first FRAME:
stop();
if (Key.isDown(Key.SPACE)) {
_root.gotoAndStop(2);
}
could someone please help me?
thanks
View Replies !
View Related
Space Above FLV?
Why is it that I always have a space above my flash movie? Invariably, I import my video, publish the swf/flv/html and the page always shows the flv minus enough room for the video skin. So I increase the dimensions for the video skin, but I cannot get rid of the head-room above the vid.
Could someone tell me what I am doing wrong?
Setting it up in Dreamweaver:
Head Space above flash file
That empty space above the flash file is always there! ?
Thanks in advance,
roml
View Replies !
View Related
Space War Help
Hi guys I have this code, which is a very cool space shooting game, but I cant incorporate sound to the game so I was wondering if someone could help me, here is the code
var nrEnemies = 3;
for (i = 1; i < nrEnemies; i++)
{
_root.Enemy0.duplicateMovieClip("Enemy" + i, _root.getNextHighestDepth());
}
var i = 0;
var score = 0;
var lives = 3;
this.onEnterFrame = function()
{
moveStars();
if (Key.isDown(Key.RIGHT))
{
if (Ship.hitTest(550, Ship._y, true))
{
Ship._x -= 7;
}
Ship._x += 7;
}
else if (Key.isDown(Key.LEFT))
{
if (Ship.hitTest(0, Ship._y, true))
{
Ship._x += 7;
}
Ship._x -= 7;
}
else if (Key.isDown(Key.UP))
{
if (Ship.hitTest(Ship._x - 40, 0, true))
{
Ship._y += 7;
}
Ship._y -= 7;
}
else if (Key.isDown(Key.DOWN))
{
if (Ship.hitTest(Ship._x - 40, 300, true))
{
Ship._y -= 7;
}
Ship._y += 7;
}
if (Key.isDown(Key.SPACE))
{
i++;
_root.attachMovie("Bullet", "Bullet" + i, _root.getNextHighestDepth());
_root["Bullet" + i]._x = Ship._x + 3;
_root["Bullet" + i]._y = Ship._y;
}
}
View Replies !
View Related
Can't Get Rid Of The Space
I have a web page with a graphic next to the .swf file. It is important that there be no space as it is part (slice) of the images being displayed in the flash file. How do I get rid of this space?
As of this writting, my hosting company was experiencing problems with thei FTP. When they fix it I will upload the file. It will be at Flash Page
Thanks
View Replies !
View Related
Space Out Mc's
i have for vertically mc which i tween to different locations on my stage. is there a way where i can tell flash to always space out my mc's by 10 pixels vertically?
View Replies !
View Related
What Is All This Extra Space?
Why is there extra flash space around ALL of my flash movies? I want my movies to be the size I have them in flash when I am creating them?! I put them on a page and there is magically all this extra "flash space". Please Help?!?! Check out my example. This doesn't even have animation or anything. just one frame a black circle, and there's still space?
http://www.geocities.com/xxsurfxx20/new.htm
View Replies !
View Related
Floating In Space
ok heres the deal...i made a 3d space man in swift, i impoted it into flash jsut fine, but i want to know if theres a way to make him float around the page and bump into object with out using motion guide, the whole hting has to be small in size and im not a master action scripter yet, but am willing to try anything, PLEASE HELP!!!!
View Replies !
View Related
Replacing A Space With A + ?
i am using this code:
Code:
on (release) {
if (name ne "", email ne "", feedback ne "") {
fullurl = fullurl add "&" add "name=" add name add "&" add "email=" add email add "&" add "feedback=" add feedback;
getURL (_root.content.fullurl, "_blank", "GET");
}
}
this add the vars to the full url that it postes to the php from: http://www.blahblah.xxx/fjjjkjaf/jod...=8458437588285 to http://www.blahblah.xxx/fjjjkjaf/jod...&feedback=xxxx
but i need the spaces changed to + ??
View Replies !
View Related
Lost In Space
Ok Im running xitami web server. Now I downloaded a feedback form from Flashkit. It contains fla swf and the cgi script which opens in notepad. How do I go about getting this thing to work? Do I have some sort of compiler to make the cgi an actual exe or what? Can someone please explain this to me in simple steps. Ive been at this battle for quite sometime.
1.
2.
3.
4.
My icq number is....133056584
View Replies !
View Related
Why Does A Space In A Textfield Becomes A
In a flashmovie I have a form, which is sent to a html page with GetUrl, method Get.
This all works, but when I fill in a space in a textfield, the it becomes a "+"sign in my htmlpage.
so this line will get to be like this (flash)
so+this+line+will+get+to+be+like+this (HTML)
anyone knows a solution?
thanks
View Replies !
View Related
|