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


ActionScript 2.0 :: Create 2d Platform Shooting Game?

I am creating a 2d platform shooting game. Currently I have my main character walking around left and right and the stage background also moves left and right.

The problem I am having is that if I go to far left the charater just walks 'off stage' and into nothingness but the stage still follows. How can I make it so if the character hits a certain point he just 'stops' and cant go left no more but can go right no problem. I have tried using hitTest with another movieclip but couldnt get it working.[code]...

View 1 Replies (Posted: 02-13-2011, 04:21 PM)

Sponsored Links:

Related Forum Messages For Flash category:
Create A Shooting Style Game?
I am at uni and have a project to create an interactive game for the story Johnny Mnemonic. I would like to create a game whereby the player has a whip type weapon, there is an opponent jumping up and down and with the whip you attack them and cut off limbs -

I'm thinking it would be like a simple shooting ducks style game in terms of coding, the player has visible just a hand with the whip in it, you move the whip to your desired location click chosen button to hit, the whip then animates a flick, if it hits correct spot on bouncing opponent then an animation of the limb flying off happens, so the bouncing opponent is like the duck and the whip like the gun - if that is right at all?

Posted: 05-07-2010, 05:01 AM

View 1 Replies!   View Related
IDE :: Create A Platform Game?
I have this problem when i go to shot and then have shot the gun all movie clips accessed after shooting dont stop playing but repeat continuously[code]...

Posted: August 29th, 2007

View 1 Replies!   View Related
ActionScript 3.0 :: Create A Side Scroller Platform Game?
I've been searching online now to find a tutorial on how to create a game like thisI don't have a lot of experience with action script I've only used flash for animations. I found 1 tutorial that was useful but it only gave code and text with out a .fla or images. If you could tell me what I need to do to accomplish this and where to put code ect

Posted: May 24th, 2008

View 13 Replies!   View Related
IDE :: Make A Platform Game - Create Multiple Levels?
trying to make a platform game using a tutorial on, but I dont know how to create multiple levels. How could I create a door that when touched by the hero is sent to the next level? The tutorial is here:


Posted: March 27th, 2010

View 1 Replies!   View Related
Android :: Cross Platform Game - IOS : Develop A Very Simple Game For Iphone/ipad?
I am going to develop a very simple game for android and for iphone/ipad I have the option to develop it in cocos2d or in adobe flash air (i am not a developer, but i have 2 developers who are offering me the service)I have a developer that states that cocos2d is better and other one that states that adobe flash air.I want it in cross platform.the cost offered by both developers is the same..i have heard that adobe air has the flaw that it is very slow, is this real? if you had the 2 options which will you use to develop your game and why?

Posted: Mar 7 at 19:08

View 1 Replies!   View Related
ActionScript 3.0 :: Flash - Writing A Simple Game Rule For A Platform Game?
I'm creating a game at the moment for my university course and it involves the player character jumping on top of boxs twice to break them as opposed to just once.What would be the most efficient/simple way of writing this in Actionscript 3.

Posted: February 28th, 2011

View 1 Replies!   View Related
ActionScript 3.0 :: Shooting Game In Flash CS3?
Shooting game in FlashView Game - Click hereKindly check game codeProblem:1) The rabbit should be random shown in ground areaif someone can give explaination onmonster.x = Math.random() * stage.stageWidth;and why the rabbit is showing bigger size?2) Other animals should also be able to target

var monstersAlive:uint;


Posted: 02-06-2009, 03:25 PM

View 1 Replies!   View Related
ActionScript 2.0 :: Top Down Shooting Game - Boundaries
I've been making this space shooting game but I'm having problems getting boundaries to work. I've read tutorials and done lots of searching here and couldn't get anything to work... On the main time line, there's 2 layers. One with the ship, and one with the background (both are movie clips). Inside the background movie clip, I'd like to add boundaries, almost as complex as a maze but not so restricting.. as in, a path to fly through that'd probably be as wide as the screen itself. Here's what I'm trying to work with. Use the arrow keys to move, space to shoot, and press control to toggle between fixed camera and fixed ship modes.

Posted: November 23rd, 2005

View 1 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)

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


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

View 2 Replies!   View Related
ActionScript 2.0 :: CS3 Shooting Game Missile Flaw
I'm making a Space Invaders-type game. Y'know? Arrow keys to fly Space to shoot? Well, shooting isn't working so well. I have two .as files: which controls the ship's ActionScript, and which is supposed to control the missile. When I hit load it up I get the error: The class or interface 'Missile' could not be loaded.

Posted: 07-15-2010, 09:10 PM

View 2 Replies!   View Related
ActionScript 2.0 :: Shooting In A Game-megaman Style
Ok I am creating a 2d game similar to the original mega mans and mario for nintendo. The character moves back and forth using the left and right arrow keys on the screen and has a walk animation and all. The next step is to get him to shoot his laser gun. I want this to be done using the space bar key. What I have right now is identical to Kirupa's movement using X and Y values tutorial but it only moves one direction of course. How can I make it so that it will continue to move automatically after pressing space instead of having to hit the space bar each time I want it to move 10 units over etc.?

Posted: April 4th, 2002

View 12 Replies!   View Related
ActionScript 3.0 :: Target Shooting Game - HitTestObject Not Working
I'm making target shooting game and the hitTestObject not working its located in the function collision detection below in my code:
import fl.motion.MotionEvent;
var xSwitch:Array = new Array ;
var count:Number = 120;
var seconds:Number = 0;
var minutes:Number = 0;
[Code] .....

Posted: 03-22-2011, 03:43 AM

View 1 Replies!   View Related
ActionScript 2.0 :: Making A Shooting Game, Would Like The Gun To Flip _xscale?
I'm making a shooting game, would like the gun to flip _xscale when you move the gun past half the width of the stage. Here's the script I made which doesn't work and is probably not written correctly:

if(_xmouse >= Stage.width/2){
_root.gun_mc._xscale * -1;

Posted: June 2nd, 2008

View 4 Replies!   View Related
ActionScript 3.0 :: Passing Function Parameters: Shooting Game 85% Done?
I have benn programming in AS2 for a while, but I'm moving to AS3, and I'm having some trouble with syntax and mostly with management of parameters and variables (actually I tried to work with functions in packages without good results T.T). The game has four different types of shooters, and all of them use the same bullet (shoot function). I have succeeded on disappearing the target (a coin in this case) when it is hit by the bullet, but the problem is that I can't quite find the way to dissapear the bullet properly. I keep receiving this message:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:isplayObjectContainer/removeChild()
at eco_adm9_fla::MainTimeline/moveBullet()


Posted: December 2nd, 2009

View 3 Replies!   View Related
ActionScript 3.0 :: Flash Background Movement For Shooting Game?
I'm doing the shooting game. In that character should move left and right by using the arrow keys. The background is movieClip with image. The character is walking very slow sometimes. And the zombies will come automatically. Why the movement is very slow sometimes?

Posted: August 30th, 2011

View 4 Replies!   View Related
ActionScript 2.0 :: Shooting Game - A Gun To Follow The Player, But The Coordinates Are Messing Up And Going To His Feet?
I'm making a flash game in AS2, and i am having troubles with my gun, i have fiddled with it for a while now and i have narrowed down the problem, but i can't fix it. My problem is that i want a gun to follow the player, but the coordinates are messing up and going to his feet.

onClipEvent (enterFrame) {
_y += (_root.player._y-_y)/1; //This code makes it goto his feet, but the gun no longer follows player when he jumps.
_x += (_root.player._x-_x)/1;[code].............

Posted: October 25th, 2010

View 1 Replies!   View Related
ActionScript 2.0 :: Simple Vertical Shooting Game - Rebound Missile Always Spawns At Left Of The Stage?
Basically, I have a border(line) at the top of the stage so that whenever my ship's missile comes in contact with this line, it is removed and a rebound missile clip is attached.Here is the missile code:

Actionscript Code:[code].....The problem is that the rebound missile always spawns at left of the stage, not wherever the ship missile was removed.I'm not sure if I should attach the fla, action script files, swf etc. to the thread. Also, my flash version is CS5.

Posted: 02-06-2011, 05:41 PM

View 3 Replies!   View Related
ActionScript 3.0 :: Add A Background In A Platform Game
I am doing a as3 platform game based in arrays, so inside the array I inserted a variable rh that inserts the bg in the stage but it doesn't show up in the stage. The code i have is:

else if (lvlArray[i] == 'ROCKYHILLS') {
var newRockyHills:backRocky = new backRocky;
newRockyHills.x = _root.stage.width/2;


Posted: April 8th, 2012

View 5 Replies!   View Related
ActionScript 2.0 :: Making Hearth On Platform Game?
I'm doing a kind of plataform map, and now I need to make health (3 hearts, like Mario). I tried to do it with hittest but the hearts goes like crazy. Guess I need to make something like invulnerable or I don't know. What I want to do is three hearts, and, if the human touches a spike he loses a hearth.

Posted: 07-09-2010, 07:08 PM

View 5 Replies!   View Related
ActionScript 3.0 :: Error #1009 In My Platform Game?
In my basic platform game I have a "hero" that can walk and jump on the "ground." There is also a door to the next scene, which is the next level.The first scene works fine, but "TypeError: Error #1006: value is not a function. at Charles3_fla::MainTimeline/frame1()" pops up once in the output. It works however, and I'm not worried about it. The second I go throught the door though, Scene 2 opens, but then starts flashing as "TypeError: Error #1009: Cannot access a property or method of a null object reference. at Charles3_fla::MainTimeline/onenter()" pops up A LOT in the output. I don't know how to fix it, and would like help. P.S. I am using Adobe CS5 with actionscript 3


Posted: Jul 22, 2010 1:50 PM

View 26 Replies!   View Related
ActionScript 3 :: Platform Game - EFrame Continues To Run
I am making a platform game in flash. I have a goal class (the class which contains code for the goal sprite, where when you hit it, it continues to next part of game). Inside the goal constructor, 2 event listeners are added, they are as follows:
addEventListener(Event.ADDED, beginClass);
addEventListener(Event.ENTER_FRAME, eFrame);

The beginClass function is fine, and only runs once, but eFrame is what checks if the player has hit the goal, so it is constantly running. The problem is, once the player hits the goal, eFrame continues to run, while in a menu describing the next scene to the player. My eFrame function is below.

private function eFrame(event:Event):void{
var lastScore:int = _root.mainScore;
_root.mainScore = lastScore;
while (_root.lvlHolder.numChildren > 0) {
[Code] .....

Frames 2, 3, 4, are frames with just text and a button that display a message to the player, and then the player hits continue. My problem is that eFrame is still trying to be run, but the class has not been instantiated, and the method is causing extreme amounts of lag once the player continues.

Posted: Mar 13 at 20:25

View 3 Replies!   View Related
ActionScript 3.0 :: Platform Game Error #1009?
I am creating a platform game and am getting the following error:#1009: Cannot access a property or method of a null object referenceThis error happens when I remove all children from the stage on line 154 of the class. Im guessing that maybe it is still listening for event in the other classes but I'm unsure how to remove these from within the document class.

Posted: 02-13-2010, 11:01 PM

View 1 Replies!   View Related
ActionScript 3.0 :: Platform Game Fall To Ground Function?
I have gotten to a point with my platform game where I am completely stuck. I have the player movement working fine but the only thing is, it doesn't fall off the blocks.

I have a Floor class which references the Character class and tells it to stop jumping when it is on a block through a hitTestObject. I have tried to research how other games have added functions but can't seem to find one which will work in mine.

Posted: 02-16-2010, 04:07 AM

View 1 Replies!   View Related
ActionScript 3.0 :: Platform Game 0 Can't Get Enemies To Face Hero
I'm making a platform game. The hero can move around, but the enemies are stationary. My problem is that I want the enemies to face the hero. The first enemy behaves correctly, but the subsequent enemies only behave correctly if I kill all the preceding enemies. I have added the hero and the enemies as Objects and put the enemies into an array called enemies. Both the hero and enemy objects have a direction property and an mc property that refers to their movie clips. This for loop gets called every frame.

for(var i:int = 0; i < enemies.length; i++)
{//face hero
if( < enemies[i].mc.x) enemies[i].direction = -1;
else if( > enemies[i].mc.x) enemies[i].direction = 1;
enemies[i].mc.scaleX = enemies[i].direction;}

Posted: 11-24-2010, 06:32 AM

View 4 Replies!   View Related
Copyright 2005-08, All rights reserved