Actionscript 3 :: Cs5 - Creating A Game Of Falling Random Objects
Oct 10, 2011
I am attempting to create a game that will simulate groceries coming down a conveyor belt. The player acts as a bagger and must click and drag the groceries into designated bags (one for cold food and one for non-cold food). When the correct choice is made the food will disappear and the score will increase +1.
I have become overwhelmed by thinking about how to do this and have not found helpful answers that actually work when I try to compile them so I decided to ask. how I can have random grocery items fall down the screen? I assumed I could create an array of movieclips and have them be called to fall down randomly, but I am not sure how this would work.
View 2 Replies
Similar Posts:
May 10, 2009
I'm trying to develop a SWF Api that consists of a game that makes random objects fall from the top, each of them has different points, and then the points the player gets should be stored into a dinamic text called score, when the player doesn't take the ball, loses a life. Then, if the player catches it, the ball disappears and gives the points to the player.
View 3 Replies
Sep 2, 2003
I am trying to make a game where you have random objects falling vertically and must land in a bucket. The bucket is controlled by the mouse(it follows the mouse).
View 5 Replies
Jul 4, 2010
currently i making this game and objects would spawn at random and be able to click but when de game starts itself, the spawn is correct but i am unable to make it stop when time goes to 0seconds.
View 1 Replies
Apr 25, 2011
I have an object calls "level" and I want to create random number of objects with random position on the stage.
I've reached how to create random position but I still have only 1 object "level" on my stage.
View 8 Replies
Apr 27, 2009
Ok I want to create a falling items game, but how do you code the falling movie clips? sorta like catch the money, or something like that.
View 6 Replies
Jan 13, 2004
i am creating a game where the user has to collect random falling objects from sky .. i canot get the objects to fall random and be collected with a hittest
View 3 Replies
Nov 17, 2008
I'm making a platform game in AS3. I've sorted the left,right and jumping movement of my character - apart from one jumpingproblem:When the up arrow key is down it sets the jump var to true.ENTER_FRAME function detects when jump = true and it decreases thecharacters y position by the var velocity while at the same timedecreasing velocity by 1.5px. So my character jumps up to a certainheight then comes down - There is a hit test to stop heump/fall. BUT when the character falls off a platform he can still jumpwhen the up arrow is pressed. I've been racking my brains but I canstop the character from jumping if its falling.
View 2 Replies
Mar 27, 2006
i want an 400 x 300 canvas with 10-12pix random size and random lattering falling from the top of the scene and i want it clickable
View 3 Replies
May 21, 2004
This question relates to the Falling Snow tutorial on this site...
How can I get the snow fall to randomly change every time the person sees the animation so, for example, you'll see falling snow right now, yet the next time you visit the site you'll see falling cars, or falling mobile phones.
View 3 Replies
Jun 30, 2009
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]
View 6 Replies
Dec 27, 2010
[Code]...
I have a serious problem with Action Script. I'm about to code a new Jump&Run game with a simple gravitation Engine. And this is where I got my problem I can not solve! When moving the player through the levels, I want to move the layers instead of him. So the player stays somehow where he is but the enemies, ground, items ... move around - as in most of these games. The gravitation is intendet to affect every item/enemy (by ENTER_FRAME) and moves every object downwards until it hits the ground.
The problem is, objects of different Layers somehow don't get the right hitTest information. So when having two objects - the first on the same layer as the ground, moving both, everything is fine. But as soon as I put the object into a separate container like "itemsContainer:MovieClip" and I move that, the object doesn't get the right result for hitTestPoints. (Maybe it has something to do with localToGlobal??)
[Code]...
View 1 Replies
Feb 19, 2011
I have randomly placed 40 pennies on the stage using a for loop, as well as making some of them smaller. They all start at the top of the stage and, right now, all fall down the stage at the same time.My trouble is trying to get the larger pennies to fall faster than the smaller pennies. I'm not sure how to single them out by size to control the speed.here is the code I have. I am only 3 weeks into ActionScript so please be specific (maybe provide an actual sample of code to use).[code]
View 2 Replies
Jul 24, 2010
I'm trying to do a simple game in which you have to move a frog in X axis to catch the falling flies. sorry if I mistake some words cuz I talk in spanish It's already done, but it has 2 bugs and I dunno what the reasons are
The 1st bug, Each time the game is over, and you click in "PLAY AGAIN ", I could notice that the frog movement (which you can move by pressing the keys) is increased a little; for example if you played 6 times the 7th you can reach the opposite side by pressing the corresponding key 2 times, despite the fact that in the code i did write only +15px for the right when you press right arrow and -15px for the left when you press the left one (on X axis) for each time the key is pressed
[Code]....
View 3 Replies
Oct 25, 2011
I have a fixed amount of words. Lets say 20 words. I want each of these words to be put into symbols - so i have 20 symbols (box1...box20). Now i want the boxes to fall from the top of the screen and until they reach below the screen. But (and this is where i'm lost) I want to have them fall at different speeds AND I want to control how many boxes falls at a time. Starting out with one box and when this box is out of the screen I want to control the amount of boxes/symbols entering the screen next.
A function telling that next there should be i.e. three boxes entering and falling/floating across the screen (from just above the top of the screen untill they all have reached the bottom). And i want to be able to call a function which starts X boxes - even before the existing boxes in the scenes has dropped). It would be nice to have a function, ie. fallBox(3) , which may be called at any time.
View 5 Replies
May 4, 2011
basically I want my engine to display one out of three objects at random. I thought I had figured it out but apparently not. A familiar error message appears, "A term is undefined and has no properties". I'm sure it refers to the object I'm trying to spawn, however it rejects every object I refer to. Is my approach reasonable or should I scarp what I've got?
Code:
var spawnObject:Array = new Array("Object1", "Object2", "Object3");
var randomNumber:Number = Math.round(Math.random() * (spawnObject.length - 1));
if(spawnObject[randomNumber] == "Object1")
[Code].....
View 5 Replies
Dec 18, 2011
Is this the correct, most efficient way to recycle objects when creating an array of objects?
package com {
public class CreateList extends MovieClip {
//this is the object I will be recycling
private var newProperty:PropertyRow;
//this is the array I will use to reference the objects
[Code]...
View 2 Replies
Oct 17, 2010
I have some code here for some falling leaves. I was wondering how it can be altered so there is a delay between a group of leaves falling and the next group falling? also to slow down at the end of the fall? [code]
View 9 Replies
Feb 24, 2009
I'm trying to create a random sequence memory game, where user has to watch over a certain sequence appears on the screen before they can input (by pushing buttons) according to the sequence appear before.I've found simon sayz code and make a modification on it.It worked flawlessly, but there is one problem with it.The code creates the sequence in this manner, e.g:
1
1 1 2
1 1 2 3
1 1 2 3 4
1 1 2 3 4 5
etc,..
while the game I'm intended to develop doesn't need that kind of increment logic, they just need to display 5 different element for starter and then the user should follow the sequence displayed on it.
View 2 Replies
Mar 22, 2009
And I am creating a box game where the user has to avoid the boxes but i want to put lives on so when the user moves over the box one of the lives goes down.
View 8 Replies
Oct 30, 2010
I am creating a whack a mole game in Flash CS5 AS 3.I have nine instances of the same movie clip that I am trying to make appear randomly as the "mole". So far I have the following script:
var girlarray:Array = new Array();
girlarray[0] = instanceofhole1;
girlarray[1] = instanceofhole2;[code]............
View 2 Replies
Feb 11, 2010
I made a memory game with a tutorial. My knowledge of AS3 is not that good so I have to following question.There is a function like Math.Random to random generate number and put them on stage. I made a memory game and the cards are on the same place every time I play the "movie".I want them to shuffle every time I restart the game. How can I write a good random function in AS3?
View 10 Replies
Sep 7, 2006
I've been working on a deal or no deal game (my first game) and I'm stuck. I just need a script to make 22 variables that are randomly equal to numbers 1 - 22, so I get a result like this:
box01 = side09;
box02 = side12;
box03 = side19;
...
...
box22 = side04;
I should probably clarify that all 22 numbers need to be different.
View 9 Replies
Sep 6, 2009
I've been wanting to learn to work with Flash for awhi l e and decided to start learning by attempting a game. I found a decent tutorial for a space shooter and used it to create the basic code (firing, etc...) and now I've been figuring out how to add other elements (splash screen/scrolling screen).now I'd like to add power-ups but can't figure out how.I've created a graphic, turned it into a movie clip, but can't think of what to define for its actions.
View 2 Replies
Mar 12, 2011
i made a set of crosshairs and i set my enemies to disappear when i click on them andeverything works fine but i noticed that my crosshairs don't line up to where i am clicking, so i go into my crosshairs which are a movie clip and move the crosshairs so the little + sign is lined up in the middle of the crosshairs, now when i play the game nothing happens when i click on the enemies unless i put the crosshairs layer below the enemies layer
View 3 Replies
Sep 28, 2011
how to create a Pong game: http:[url].... There's a link to the source code: http:[url]...file=pong4.txt.When I add the source code to a new AS file (using Flash CS 5.5), save it as "Main.as", create a new Fla and link it in the actionscript settings to the Main.as and run it, I get errors:
C:UsersxxxDesktopP4Main.as, Line 1171093: Syntax error.C:UsersxxxDesktopP4Main.as, Line 1171084: Syntax error: expecting rightparen before 270.C:UsersxxxDesktopP4Main.as, Line 1211093: Syntax error.C:UsersxxxDesktopP4Main.as, Line 1211084: Syntax error: expecting rightparen before 270[code]....
View 2 Replies
Apr 30, 2010
I've tried a variety of tutorials and had no success in creating a preloader for my game.I can't seem to get all of my library items to load in frame 1 properly. Any tutorials that I try do not achieve the preloader effect that I desire.What I would really, really like is this:A .swf file that wraps my .swf game and puts in a preloader.That's it.How do I do this, or specifically, what should I be typing into the search window of this forum?
View 2 Replies
Nov 5, 2009
So i need to create a 3D game in flash. What is the best way of doing that? Do I need to use Papervision 3D, or can I just import 3D animations and code it in Flash?
View 4 Replies
Dec 30, 2009
I am making sims like game and right now I am trying to figure out how I will structure my objects. right now I am thinking to create a class called GameObject, the psuedo is below
public class GameObject {
name:String
width:int
height:int
}
This way I could create objects like bushes, trees, and buildings. But then I began to think. what if I wanted to create multiple buildings and trees of the same type ?? I would have to keep making instances of GameObject and giving it a new name and height and width. The properties would have to be the same values in order for me to duplicate one object. That seems a little tedious. Then I figure , maybe that isnt the right way to go. So I was thinking, I would have to extend GameObject like below
public class Tree extends GameObject{
birdHouse:Boolean
}
public class Building extends GameObject{
[code].....
Now this way I can create a class that has a method that loosely accept accepts any type that inherits GameObject.
Selector.loadObject(gObject:IGameObject);
Depending on what type it is (i.e tree, building, house) I can use a case statement to figure out which type it is and evaluate it accordingly.
I also created a Tile Class that will pass through the loadObject method. It also will be a child of the GameOject class. if the case statement finds that it is type Tile, it will highlight whatever Tile depending on what tile my mouse is over.
My second question is if a class inherits a class that implements a interface, is that class child class considered to be a IGameObject as well. or does it have to implement that interface directly. does all this sound like I am going in the right directions lol, as far as organization is concerned.
View 3 Replies
Feb 18, 2009
Suppose I have a list of 100 enemies on the stage like this (pseudocode):
Code:
// init:
enemies = new Array();
for (i=0; i<100; i++) {
temp = new Enemy(a, b, c);
stage.addChild(temp);
enemies.push(temp);
}
Now enemies is an array of all the enemies, so I can update all of their positions, and other properties, each frame. Is this a good way to do things? Because I just realized that I'm storing each enemy twice: One time in enemies Array and one time in stage.children. Maybe I should get rid of the enemies Array altogether, and just use stage.getChildAt() to update the enemies?
View 1 Replies