Actionscript 3 :: How To Make Object Reset The Game
Dec 30, 2011
I am a student working on a project with flash. I am simply trying to make a flash game using Actionscript 3 in Adobe Flash CS5. Everything is working fine, i can walk and jump, but I want the game to restart if the Main character touches an object and dies (like spikes in a pit). I have a main menu in frame 1 and the first level on frame 2. The main character is called "player_mc" and the object that kills him is called "dies".
Code:
//The Code For The Character (Player_mc)
import flash.events.KeyboardEvent;
import flash.events.Event;
I am new to flash and im trying to make a game. Im stuck on hitTest. I have many black boxes falling down and I want the game to reset when the black boxes touch my red circle. I used this code for my boxes:
[AS] this.createEmptyMovieClip("canvas_mc",10); myInterval = setInterval(addbox1,500); function addbox1() { [Code] ..... My red circle is controlled by the mouse. The code for that is: [AS]onClipEvent (load) { startDrag(this, true); }[/AS]
I have an issue with adding a reset button to my drag and drop movie clips.The problem is, if a student drags a movie clip to a wrong location on the SWF file I want them to be able to hit a reset button that would take them the same SWF that they opened and what would showup would a clear page for them to restart their drag and drop exercise.I know how to make the button for this just want the proper action script to be able for user to start over with no movie clip symbols on the page.
I am trying to make a game in Flash using Action Script 3,
I have everything in the game and the game works, but I am trying to add a restart function so the game will go back to the start of the level when you pres the 'R' key.
My game starts off with a title screen on Frame 1, and there are 2 levels, 1 is in frame 2 and the other is in frame 3.
When you click the level you want on the title screen it takes you to the frame which has the required level in it by using a gotoAndStop[code]...
i have spent several days on this and still can't get it to work. The code below is ok, I am playing a bowling game using the keyboard and timer with a text readout of the elapsed time, the bowl moves a set number of pixels on the screen. whilst in full screen mode I would like to click a start/play button on the screen to start the game and timer again, everything is in frame 1. Also I would like the game to just accept the keycode 77 and keyboard event (2 events only to move the bowl) and then wait for the start/play button click.
I tried adapting a bit of script from one Tonypa posted some time ago about making a hidden objects game.I want to have a movieclip play on top of a randomly selected movieclip from an array, but I don't seem to have it.Here is the hint script part.....
this._parent.hint.visible=false; function showHint () { var n=Math.floor(Math.random()*this._parent["object" + i].length);
I am creating a board game and I am using Object Oriented Programming with AS3. I created a movie clip with a circle that moves across the game board. There are 18 squares and 18 frames. I have a button that gives you a value with a dice with the random number function:
public function rollDie():void {_dieValue = Math.ceil(Math.random()*6) this.gotoAndStop(_dieValue);}
I have a class for the dice button, die, gameboard, and the main board. I am trying to make the circle move across the board(or go to the frame in the mc) depending on what the value I get with the dice. Here is my code so far:
[Code]....
The mc instance for the gameboard is gameBoard. Also, if anyone knows how to trigger a labeled frame depending on which square the circle lands on that would be a plus.
The code i have for my brick breaker game is this one (followed by a tutorial): The thing is that i can't get the game to restart with 1 less level when the ball hits the bottom. Anyone knows how to do this? I've tried to run the function makeLvl(null); after the part where it says lives--; but it still doens't work. PHP Code:
Basically what happens is 5 eggs fall from the top of the screen. What I'm trying to have happen is, to have flash recognize when all 5 have been clicked and goto and stop on frame 3. The other problem is I want the animation to reset when the timer runs out. Thus clearing all current eggs off the stage. I've zipped the 2 files I'm working with the (fla and as files).
I was trying to make a game, and the character inside the game could swim. However, I only wanted him to swim in short bursts that refueled every time he hit the ground.
how to make a game tutorial as farmville game tutorial to teach the user to play the game. i have recently involve in make that kind of game tutorial for its user by actionscript 3
with a "what should be fairly simple" problem I am having with the quiz template. I have a 5 frame quiz that I've developed from the template. All 5 interactions are Hot Object interaction types. The problem I am having is when I go from one frame to the next, the Hot Objects do not reset. Whatever the selection from the previous slide was, remains in a selected state.
I've tried renaming the Interactions in the Component Inspector, but that doesn't work. If I put some other interaction between two Hot Object Interactions, no problem. It's only when they are consecutive.
i wanted to make an object to reset to the default position, like i move it around and when i hit a button he goes to his position for example x: 233 and y:431
I recently made a flash banner that changes frames when you click the next frame and last frame buttons, and it also goes to the next frame on a timer. The thing is, I need the timer to go back to it's starting point when you click one of the buttons, so you don't end up seeing a frame for 2 seconds. Initially, the timer starts at 7 seconds, and when you click a button, I'd like it to go back to 7 seconds. Here's my .FLA file:[URL]
Also, whenever the banner goes through all of the frames and comes back to the first frame with the buttons, the first frame next_btn stops working for some reason.
Just new in forum and just new in as3 programming. All i want to do is to make some physics simulations (i'm physics teacher...). So i made my first sim with the following code, just to simulate a simple motion with constant velocity. It works ok, except the part i need to reset the display by the means to start the motion all over again (reset button). Then the motion starts but the traces of the previous motion remains on stage. I tried the null command (sp=null) but the sim could not start again because the sp nedded to be non-null...
I used this tutorial to make an accordion for my website and I am trying to figure out if there is a way to make it reset to default when you mouse off of the accordion any help would be greatly appericated
Would it be possible (Without being extremely inefficient) to loop through a display object and reset their children's ChildIndex based on their y value?
I made this simple AS3 game that generates a random amount of stars on the stage. The user has to count the number of stars, punch that number into the input box and hit submit.The problem is that if the user wants to play again, he/she will have to go through the hassle of closing and re-opening game. That's why i'm now wondering how to make a reset button that re-generates the stars for the user to count again.URL...
reset in google yields only its use for timers.However I have code bg.reset() which I suppose puts the background back to the beginning of its timeline.
i want to make the character in my flash game make a jump when the player presses a key,e.g. 'space',even the player release the key instantly,the character will still finish the complete jump process.
i'm currently using hitTestObject and it kinda sucks, my object doesnt get very close the the second object but the game "thinks" it does. is there a better hit detection?
I want to make a reset/restart button using "Enter" and it worked before.. but i realised that once you press it the background has moved so you cant see the menu screen..
I am currently making a game. The user drags back the fish and then lets go when it gets to the desired force and angle. If it hits the penguin it disappears however i want it to rebound off the iceberg so it can bounce off and hit the penguin. However it just disappears i've tried everything and i cant work it out.
I am developing a ipad game using flash CS5. When I run it in flash or web browser, it run quite smoothly but when I published it into ipa file and run it on my own ipad, it became very very slow. Since my game has many stages and characters, the amount of symbols may up to more than 50. That makes the flash file more than 100mb (but the ipa is only 11mb) All of the symbols are exported in frame 1.
1)if I used preloader and exports the symbols in frame 2, will my game run more smoothly? is one preloader when the game is loaded enough? or it is need for every game scenes?
2)Is there any other technique that a big game developed in Flash has to follow in order can be run in low configurations devices?
3)Why many other big game can run so smoothly although it contains a lot more characters and background than mine?