ActionScript 2.0 :: Switching Bullet Type In Game?
Nov 30, 2008
[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.
View 4 Replies
Similar Posts:
Mar 27, 2009
It seems any type of linebreak within an <LI> tag create an extra bullet?The following examples all produce 2 bullets when they should only show one...
Code:
_txt.htmlText = "<li>Hello<br />There...</li>";
_txt.htmlText = "<li>Hello /n There...</li>";
_txt.htmlText = "<li>Hello /r There...</li>";
_txt.htmlText = "<li><p>Hello</p> <p>There...</p></li>";
Flash Player 9, AS 2.0
View 3 Replies
Feb 18, 2009
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]..
View 2 Replies
Mar 16, 2010
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]..
View 1 Replies
Mar 16, 2010
-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
Mar 25, 2011
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]....
View 5 Replies
Nov 24, 2008
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]....
View 3 Replies
Oct 20, 2010
I've noticed since the last few version of flash player that when your main view isn't focused on the flash game, it tends to mess the game up.How do I make it so the game automatically pauses when I switch to a new window or lose focus.
View 6 Replies
Mar 28, 2012
im trying to create a tamagotchi game type game. For some reason i can not add any items to the stage.Currently i have imported 2 png images to the stage and coverted them to movie clips. One is called TamagotchiCharacter and the other is called Beer. I have also created a new 2 AS3.0 script class called TamagotchiGame and DraggableItem. The following is TamagotchiGame:
Code:
package {
import flash.display.MovieClip;
public class TamagotchiGame extends MovieClip {
[code]....
I have assigned the above code as the BaseClass of the Beer symbol, this has allowed the beer to become draggable and droppable etc.when i run the program nothing happens, i just get a blank white screen.
View 2 Replies
Oct 4, 2009
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.
View 10 Replies
Jul 8, 2009
I've got game for kids where you click the right coloured circle.Its not really a game as I'm writing my dissertation on designing interfaces for kids. You didn't ned to know that. Basically, I've made a game where you click the right coloured circle to go to the next level, and what I need is a timer that starts when you click "play" and ends when the last circle is clicked. This is so they can see how long it has taken them.
I have uploaded the fla file here http:[url]....f you could take a look, it's not a big file.I have searched for a while and Ive managed to make counters but only ones that start when the movie loads and I don't know how to stop them.
View 2 Replies
Jul 10, 2009
When I try to compile a game I am developing that includes the class below I get one of two errors:
1046: Type was not found or was not a compile-time constant: DataChangeEvent.
or
1046: Type was not found or was not a compile-time constant: Event.
I am on Flash CS4 with the Flex SDK 3.2.0 installed and all library paths set in the little project properties window and general prefs. I really ned to get this thing done. I can't just copy and paste the source now, because I have images in my library I have no idea how to get linked classes, etc out.
Code:
package {
import fl.events.*;
import flash.display.*;
import flash.events.*;
public class PencView extends DisplayObject implements IPencView{
protected var model:PencModel;
[Code] .....
View 3 Replies
Sep 11, 2003
does any1 know or have done any 'scratch and win' type of game in flash?
View 4 Replies
Mar 23, 2002
I want to make a screensaver that has a maze game on it, It will be controlled by using the arrow keys on the keyboard. The only problem I have is working out how to make the movie detect the walls and stop the square (what the player controls) going through them.
View 2 Replies
Jan 18, 2010
I'm thinking of building a game along the lines of Farmville - items, events, time management system etc. Options I am thinking of:
1) Flash UI frontend that uses AMFPHP to get all data for the view from a PHP powered backend.
2) Actionscript to power the whole game
My concern with Actionscript is scaling, my concern with PHP is having to build an update system that would need a lot of back and forth xmlhttprequests which might get complicated.
View 5 Replies
Feb 14, 2012
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?
View 9 Replies
Aug 5, 2011
seen a tut on a boggle type game - making words from a selection of letters. You type in a word and then it is checked against the array word list.etc...
View 1 Replies
Mar 20, 2010
I was just fooling around in my spare time and have made this cool interface and game-playing code for a Connect-4 type game, written in Flex and playable by 2 human players in Flash. It accurately detects wins, etc. I'm smart enough to know that I've done the easy part.Before I dig into an AI for game play, I wanted to ask if this is the kind of thing that can really be handled computationally by a Flash plugin. It seems to me that for every turn up until the end there are 8 possible moves, 8 responses to each move, etc. So wouldn't a perfect engine have to be able to potentially see 8^8 moves (over 16 million), and a fairly good engine see up to a million? I don't know game coding so this is new to me. What's a reasonable move horizon for such a game to be able to see?
View 1 Replies
Oct 28, 2011
sorry for the misunderstandings in my program, i'm quite new here and i am also new in using flash. here is the sample output that i used in my code
[Code]....
View 2 Replies
Jul 7, 2011
if I make a Super Mario platform jumping game - should it be bottom left ie: the hitPoint of his feet and the platform he lands on.
View 3 Replies
Apr 3, 2012
I have the actionscript code here for a bubble popping game. When the game starts, bubbles fall down from the top of the game to the bottom and score is kept for the most bubbles clicked or popped in 30 seconds.The size of the bubble is defined by the initialize method in the code, and uses ToString() to calculate the score. ToString gives me a 1061: Call to a possibly undefined method Random through a reference with static type uint. This error which I cannot figure out where it comes from.[code]
View 4 Replies
Aug 20, 2011
I am trying to make a bowling alley type of game. I want the ball to change angle when it reaches the gutter, but the problem I am facing is, how can I check when the ball has reached the gutter as the bounding box for a line/box in perspective is bigger and I want to check any point on the line when the ball is passing/crossing that point and moving so that I can change its angle and direction. And also does anybody have a collision method algorithm or physics to create the falling of PINS when the ball hits the PINS.
View 1 Replies
Jan 22, 2012
Now getting this error: Symbol 'levelcomplete'1046: Type was not found or was not a compile-time constant: nextlevelBtn. Hi guys, Beginner here having some trouble creating my first flash drag and drop jigsaw puzzle game. The drag and drop jigsaw puzzle works to some extent, but it is the "level complete" movieclip which is causing problems. On testing the movie i get this error:1061: Call to a possibly undefined method addEventListener through a reference with static type Class.
[Code]...
View 3 Replies
Apr 22, 2009
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.
View 1 Replies
Nov 26, 2010
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.
View 1 Replies
Nov 25, 2010
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.
View 1 Replies
Mar 17, 2009
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].....
View 3 Replies
Nov 26, 2010
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.
View 1 Replies
Jan 18, 2010
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.
View 1 Replies
Sep 21, 2010
I've made a scrollable text field with the UIScrollBar component. Now I need bullet points in that text. How do I create them?
View 1 Replies