Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash


Advertisements:










IDE :: Tower Defense Game Bullet Disappear?


-What i want - once the bullet hits a monster OR goes out side of the range of the gun it disappears and another shot can be fired (which is done automatically via my script no user input needed)

-What i have - when the bullet goes off the page (x>550, x<0, Y>400, Y<0) it disappears and another shot can be fired... obviously this is problematic to game play...

Code:
Stop();
base_range = 200;
can_be_placed = false;

[code]....


View 1 Replies (Posted: March 16th, 2010)

Sponsored Links:

Related Forum Messages For Flash category:
Tower Defense Game Bullet Disappear
I found a tutorial on the internet and have begun toying with it. I figured out what all the segments did and how they worked and effected the game (mostly through trial and error...) once i figured out what EXACTLY i had i started making changes.

-What i want - once the bullet hits a monster OR goes out side of the range of the gun it disappears and another shot can be fired (which is done automatically via my script no user input needed)

-What i have - when the bullet goes off the page (x>550, x<0, Y>400, Y<0) it disappears and another shot can be fired... obviously this is problematic to game play...

[Code]..

Posted: March 16th, 2010, 10:19 PM

View 1 Replies!   View Related
Flash :: Tower Defense - Detecting If The Bullet Hits The Enemies
I am creating a tower defense game and I want to make a tower that shoots a bullet and every enemy that the bullet hits is damaged. The bullet can hurt multiple units. My problem is detecting if the bullet hits the enemies. Right now, I have the enemies in an array. With other towers, when an enemy is in range, the tower fires and when it hits its original target, it causes damage to that target.

For the tower I want to make, it will shoot the bullet the maximum range every time and I need it to damage every unit it hits on the way to that final destination.

Posted: Apr 22 11 at 0:42

View 4 Replies!   View Related
ActionScript 3.0 :: Tower Defense Type Game - Object Access?
I am hammering out a Tower Defense type game. I'm starting to design my custom unit mechanics. I've used numerous other tutorials for the framework here (largely one mans blog - credited in my AS3 file..) I want when a unit dies, that it runs a function - checks a field I've created within the unit called a 'tag' - and depending on that do other things. From within the kill() function I successfully call my infantryDeath() function, and I've verified within kill() it's recognizing the dead objects tag. I've verified the entry into infantryDeath() and that the tag is still the same.

Here's the problem:
function infantryDeath(creep){
//inGameMessage("infantryDeath() successfully called"); <-- works
//inGameMessage("Unit died with ID: " + creep.tag); <-- properly shows the ID of the "creep" it received
inGameMessage(this); <-- prints out _level0 (the id for the level itself)
if (creep.tag = c1) <-- the unit with this tag dies, and triggers this block successfully{
[Code] .....

I have no clue why the object I'm supposedly working with changes just by virtue of being within the "if" block. If I pass an object into a function shouldn't manipulating that object remain constant within that function?

Posted: 02-14-2012, 12:23 PM

View 9 Replies!   View Related
ActionScript 2.0 :: Defense Game - Randomize Enemies?
I'm making a little tower defence game but i've run into a problem;I need a code to randomise my enemies (like in which direction they come from, and how many come)

Posted: October 6th, 2007

View 1 Replies!   View Related
Flash :: Make A Tower Defence Game In Adobe?
I'm a Flash newbie that wants to make a Flash game. However the only explenation on making a Tower Defence game that I've found is this one[url]...

It however uses a program that's unknown to me while I got Adobe Flash Pro. CS5 (Trial version) after some googling.

Posted: Nov 9, 2010 8:23 AM

View 3 Replies!   View Related
ActionScript 3.0 :: Make A Bullet Disappear When It Hits A Target?
I have created a class named Bullet() and I create a child named bullet_mc every second.This bullet_mc moves to a direction on the stage.I also created a class named Plane() and I create a child named myPlane_mc every two seconds. Also, every myPlane_mc moves to a direction on the stage.

Posted: Jul 30, 2011 7:11 AM

View 5 Replies!   View Related
ActionScript 2.0 :: Shooting Game Bullet Removal?
So the problem is basicly this: It all works just fine, but when the bullet hits the target it gets destroyed (this is ok) but also any bullet that was shoot before it (meaning also: with a lower y) gets destroyed aswell wich is anoying. Here's the code (left the comments so you can find your way around easier)

Code:
stop();//add a stop function too!
enemyspeed =1
life=3
var gameOver:Boolean = false;

[Code]..

Posted: 02-18-2009, 04:20 PM

View 2 Replies!   View Related
ActionScript 2.0 :: Switching Bullet Type In Game?
[URL], but this is a completely different question. I now have a fully functionnal jet plane which fires tiny red bullets. Now, I want to be able to alternate between bullet/ammo types on the fly, (with a shortcut like shift or something, but not neceserilly that) from the red bullet to something like a yellow laser. I'll attach the file I have up to now.

Posted: November 30th, 2008

View 4 Replies!   View Related
ActionScript 3.0 :: Setup Bullet Factory/bullet Switch For The Same Player Object?
I'm currently making my own shoot'em up game where the player can switch between two player types which will fire their own bullet type in this case, squares and circles. I've setup the player switch function via pressing "space" button (switching between the two player types) and the default bullet type is "squares" and I'm not sure to approach the coding with changing the bullet type to "circles".I've written 2 classes for the bullet and player setup:Player Class: Creates instance of bullet on screen and enables the switch player type function

Bullet Class: Enables bullet properies and bullet types Player Class: Code:function onKeyDown(event:KeyboardEvent):void {if (event.keyCode == 32) //// pressing/holding "space bar" to function

[code]....

Posted: Mar 25, 2011 6:34 AM

View 5 Replies!   View Related
ActionScript 3.0 :: Shooting Multiple Bullets - Press The Space Bar The First Bullet Disappears And The Bullet Animation Starts Again
I'm trying to make my platform game character shoot a gun, my character and gun are one movieclip and the bullet is another. The bullet mc starts on a blank frame with a stop() function, when I press the space bar the bullet mc plays from frame 2 which is a motion tween of the bullet quickly moving across the page. I've set the bullet's y and x values relative to the character mc so that the bullet always comes from the gun.

My issue is that if I press the space bar a bullet will fly out of the gun (great!) but if I press the space bar again, the first bullet disappears and the bullet animation starts again. I want to be able to shoot a new bullet every time I press the space bar without effecting the bullets that have already been shot.

[Code]....

Posted: Nov 24, 2008 9:45 AM

View 3 Replies!   View Related
ActionScript 3.0 :: Set The Bullet.x To Ship.x In The Bullet Class?
i have 2 classes, one for ship one for bullet.i was trying to set the bullet.x to ship.x in the bullet class but it keeps telling me undefined. but clearly it is in my ship class.

Posted: October 4th, 2009

View 10 Replies!   View Related
ActionScript 3.0 :: Whack A Mole Game (Object Show Up Then Disappear)
I'm doing a game like whack a mole but I'll do it as easy as I can. I'll use only mouse to click on the object, then get 1 point. And I want the object/figure show up by random and then disappear like whack a mole. I could make it shows up and then disappear but my problem is I can't stop it and I don't know what function I should use for counting point when I click on the object.

Posted: February 26th, 2010

View 1 Replies!   View Related
ActionScript 2.0 :: Cant Access Array From Tower Class
im doing a tower defence game and i have a problem rotating my towers towards the minions.my idea is, on the Main class e create an array with all the minions, than, on the Tower class i want it to go through the entire array and search for the closer one.the problem is, i cant access the array from the Tower class.How can i solve this, and if it isnt possible, how can i make the tower rotate?

Posted: 07-11-2011, 08:27 PM

View 2 Replies!   View Related
ActionScript 2.0 :: CS3 : Remove Multiple Movieclips From Tower Defence?
I have a tower defence and when you lose I have a button to go back to the main screen. Only problem is that I cannot find a way to remove the enemies from the screen as well. Here is all of the code for the game, because I figure I might as well give you everything now, than later. I also wanted to give you all my variable names that would be used...

Code:
stop();
// Params = Number, Health, Speed, Time between releases, Gold per creep);
_root.waves = [[10, 50, 2.500000E+000, 2000, 2],

[code]....

Posted: 03-05-2009, 10:48 AM

View 3 Replies!   View Related
ActionScript 3.0 :: Remove/delete A Movie-clip Once A Button Has Been Pressed (Selling A Tower)?
What I'm trying to do - remove/delete a movie-clip once a button has been pressed (Selling a tower)My problem - Is that from my limited knowledge none of the following work.

removeChild(myTower);
Turret.removeChild(myTower); - (trying to reference the class of the turret so that it can access the movieclip)
Turret.parent.removeChild(Turret)
Turret(root).removeChild(Turret)

This function is placed in the first frame of the source.fla where all main functions are.The turret has its own class defining its properties and such.Basically what i want to happen is when the button function is activated to remove the movieclip Turret and the class from running.

Posted: March 4th, 2010

View 4 Replies!   View Related
CS3 Dynamic Textbox Bullet Bug
I've been working with Flash for over 3 years, but I can't figure this one out. I've got a body of text, half of which are bulleted points designated by <li></li>. It's loaded into a html-ised dynamic textbox.

[Code]....

It displays fine as is. However, if I make the box selectable, and select any part of the bulleted list, the ENTIRE body of text turns into a giant bulleted list, including the non-bulleted portion at the beginning. I've managed to replicate this bug with Flash 8 and CS3, using a variety of flas made from scratch.

Posted: 04-22-2009, 04:09 AM

View 1 Replies!   View Related
ActionScript 2.0 :: Bullet Is Not Starting From The Car?
I'm creating a small car game where you shoot from the car, so I've made a bullet animation with this code inside the mocieclip:

Actionscript Code:
shellNo = 0;function shellEject(){shell_holder.attachMovie("shellAnim", shellNo, shellNo);shellNo++;}

But the problem is that the car is moving when you controll it so the bullet stays on the same position and I want it to follow the car and start from the same position as the car whereever it goes.

Posted: 11-26-2010, 10:18 AM

View 1 Replies!   View Related
ActionScript 1/2 :: Bullet Is Not Starting From The Car
I'm creating a small car game where you shoot from the car, so I've made a bullet animation with this code inside the mocieclip:

shellNo = 0;
function shellEject(){
shell_holder.attachMovie("shellAnim", shellNo, shellNo);
shellNo++;
}

But the problem is that the car is moving when you controll it so the bullet stays on the same position and I want it to follow the car and start from the side of it whereever it goes.

Posted: Nov 25, 2010 11:55 AM

View 1 Replies!   View Related
IDE :: <br> Within <li> Creating New Bullet Point?
I have some code in for a dynamic text field:

<ul><li>Item one</li>
<li>Item two line one<br>Item two line two</li>
<li>Item three</li></ul>

[code].....

Posted: March 17th, 2009

View 3 Replies!   View Related
ActionScript 2.0 :: Bullet Is Not Starting From The Car
I'm creating a small car game where you shoot from the car, so I've made a bullet animation with this code inside the mocieclip:

[Code]...

But the problem is that the car is moving when you controll it so the bullet stays on the same position and I want it to follow the car and start from the same position as the car whereever it goes.

Posted: November 26th, 2010

View 1 Replies!   View Related
Way To Remove 'Enemy' When It Comes Into Contact With 'bullet'
Basically i just need a simple way to remove the "Enemy" when it comes into contact with "bullet".Ive been looking on the internet but its just really confusing me at the moment. And im not sure how easy its gonna be with the way i have set it up.

Posted: 01-18-2010, 03:31 PM

View 1 Replies!   View Related
ActionScript 1/2 :: How To Add Bullet Points To TextField
I've made a scrollable text field with the UIScrollBar component. Now I need bullet points in that text. How do I create them?

Posted: Sep 21, 2010 7:22 AM

View 1 Replies!   View Related
Flash :: Program The Path Of A Bullet?
I am playing around with ActionScript 3 and trying to build a very simple prototype for a video game (top-down action/shooter) and realized that handling bullets is a little bit more challenging than I originally imagined.

In order to get a fairly decent "flight" of the bullet between the character and the target, I ended up using a highly modified version of Bresenham's Line Algorithm to determine the flight path of the bullet and then merely draw a tiny flash.geom.Rectangle object at the appropriate place on that "flight path" during the draw-frame stage of my application.

I haven't noticed any real problems, but I just can't imagine this being the best way to handle bullets in a Flash game. I imagine that once there are multiple enemy players on the screen and lots of bullets flying around (especially once I code in automatic weapons) that things could come grinding to a halt.

What am I missing here? I'm not really a game developer and so most of the things I'm doing I've just "made up" on the spot, but I can't figure out how to effectively handle bullets in Flash.

EDIT: As requested, here is "my" Bresenham code. I say "my" in quotes, because I basically ripped this from somewhere on the internet. My changes to the algorithm basically involve the lines at the bottom. The original implementation would find the path from player character to the target, except that every once in a while (and I wasted a little bit of time trying to figure this out but never got anywhere) it will generate the path from the target to the player. To "fix" this, I ended up just checking the first X/Y values from the path array and reversing the array if those values didn't match the X/Y values of my player character.

[Code]...

Posted: Nov 8 10 at 17:04

View 4 Replies!   View Related
ActionScript 2.0 :: Firing One Bullet Per Press
im just testing some stuff, and everytime the space key is pressed i want one bullet to come out, however righty now you can just hold down space and it keeps firing...heres the code i used [code]

Posted: July 27th, 2004

View 11 Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved