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




I'm Building A Game



Hey,
I'm a beginning Flash/actionscript programmer and I'm trying to build a game. I'm stuck trying to code the collisions in my space invaders type game. Basically what I need is a way to check if two movieClips are intersecting(collision). Can anyone lead me in the right direction?



ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 08-27-2008, 05:42 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Building A Flash Game? Help Please.
Hi there.

I'm looking into making a flash game, but im not to sure where to start.


The basic idea is to have an person scroll left to right trying to catch things falling from random places from the top of the screen.
There will be two object falling. One object (object 1) should add to the score and the other object (object 2) would be taking away from the score, more or less.

The idea is that if they got to much of either object the game would be over. They user would have to maintain a healthy medium between the two.

Also, the persons graphic would increase if they had two much of object 1 and would decrease when they have object two.

I hope this makes sense. And I hope someone here would be able to help me out with some links to tutorials and such..


Like I said... I've never made a game before. But I am pretty good with flash.

Thanks

Isometric Game Building
I'm a little new to AS.
does anyone know any good tutorial site for information on how to build isometric adventure games.
Thanks

Leaving A Building In An RPG Game
Hi, I am currently making an RPG in flash MX,

I have all the basics working in the game, but I am having problems when I want a character to leave a building.

I need the character to be placed outside the building he has just left when he exits it.

I can make this work when the user presses a button to exit a building using the following code:

code:

on (release){
gotoAndPlay(2);
with (_root.player) {
_x = 106
_y = 213
_rotation = 180


}

}



where player is the movie clip that I want positioned and rotated to show it has just left the building.

The problem is where I use a hit test to exit the building, so the user can walk out.

code:

if (_root. exit.hitTest(_x, getBounds(_root).yMax, true)) {
_root.gotoAndPlay(2);
with (_root.player) {
_x = 106
_y = 213
_rotation = 180
}

}



The above section of code is included in a frame where there is a movable object controlled by the arrow keys.

The section of code is already in a “(with_root….” statement and I am not sure if they can be nested. The character exits the program at the moment, but the player movie clip is not set to the right (x,y) value.

If anyone has any ideas I would be grateful, thanks, Mark

Building A Game Like Bowman
Hi everyone. I am new to the forums. I really like this site and the community seems great, so I look forward to contributing.

Now for the obligatory problem. I want to build a game similar to the Bowman game (available at http://sapporo.cool.ne.jp/f1ash/flash/bowman.swf as well as other places). In this game, you fire an arrow at another bowman who is usually a good distance to the right of the main view. As the arrow travels, it stays in the middle of the view until it hits either the other bowman or the ground. I would like to duplicate this effect. Any ideas? I am not sure how to make the focus of the movie stay on the moving arrow. The arrow leaves the screen and that's it.

There might be that there is a really easy solution, since I am pretty new to Flash and Actionscript. Thanks in advance.

Building A Game In Flash
Hi there.

I'm looking into making a flash game, but im not to sure where to start.


The basic idea is to have an person scroll left to right trying to catch things falling from random places on the top of the screen.
There will be two object falling. One object (object 1) should add to the score and the other object (object 2) would be taking away from the score, more or less.

The idea is that if they got to much of either object the game would be over. They user would have to maintain a healthy medium between the two.

Also, the persons graphic would increase if they had two much of object 1 and would decrease when they have object two.

I hope this makes sense. And I hope someone here would be able to help me out with some links to tutorials and such..


Like I said... I've never made a game before. But I am pretty good with flash.

Thanks..

Building A Game In Flash
Hello, first of all i want to say that i am new here. It seems to be a very nice forum i think.
I am going to build a little game in flash and want some help/tips how to do it.

The game should work like this:

A bunch of single objects should be able to be moved with the mouse and also rotateble in som way, in steps within 45 degrees.
When the user have dropped the object where he/she want, the object should stay there.
It should also be able to move more than one of every single object.
And at last it should be a 'reset' button to reset the game with!


Hope someone can help me with info/tios/codes!

thanks!

404 Errors - Building An Arcade Game
http://www.flashkit.com/tutorials/Ga...u-78/index.php

Hi, I really want to do these tutorials but the pages aren't there, can anyone help?

Help Building Drag / Drop Game
I am trying to build a basic drag and drop game in Flash MX that applies different scores to the objects you choose to drop and calculates an overall score as you go. I know how to build the drag and drop bit - what I do not know is 1. how to apply a score (value) to each different object 2. How to calculate the score as you add more objects and 3. How to make a 'score' bar move up or down depending on the current score.

I am a bit of a Flash novice and any help would really be appreciated!

Building A Flash MX Memory Game
Hello All,

I used a tutorial off this site by Gant to build a Memory Card game in Flash MX. You know the type that displays so many cards...and you flip one over at a time and try and match it to another until all the cards are matched. I think we all have seen or played that game.
Anyways...it took me a long time to get it all put together-but in the end is not working because I do not know where to put the 'function coding'. Anyways....does anyone have a good tutorial on making this game?

Also...I am looking for a tutorial on making a 'sliding puzzle' game in Flash MX as well. You know....you have a simple picture--cut it into squares and scramble it up. Then the tiles have to be slid into place to make the picture appear.

If anyone has any good tutorials for these games or can direct me to them I would really appreciate it---I suck bad when it comes to games!
LOL

Thanks in advance...

[MX] Building Character For Non-game Animation
I wouldn't consider myself terribly new at flash, but this is one thing that stumps me, bad.

How do I properly build an animated character? What I have right now is a little complex in the sense that it has arm and leg joints, torso pivot point, various hand positions, eyes, mouths, etc. I keep hearing about nested symbols, but I don't think I'm doing it right because sometimes they don't work when I test the swf. Some do, others with identical construction do not. When I take them out into another fla, the parts work on their own, but I don't really know what that means. I was under the impression that you'd nest movie clips(or graphics?) within movie clips, the outermost clip could then be manipulated while the inner clip would just go through its animation cycle unaffected, making it easier to animate things like arms and legs, etc.

Is there a thing as too much nesting? (character>left arm>lower arm>forearm & hand) Do I have to use action scripting? Should graphics be used inside the movie clips or should everything be movie clips?

Strategy For Building Board Game In AS3
Im a decent intermediate AS3 programmer looking to create a board game in Flash using AS3. The problem that Im having is identifying how to control the navigation of the players tokens around a board, both visually and programmatically. I dont have any code or graphics set in stone as Im just starting to conceptualize the idea, but Im thinking the board will consist of several spaces that form a loop, and not all of them will neccessarily be squares or rectangles. There could be some that are curves or otherwise unique shapes. Becuase of this, I cant simply create a grid and use that as the spaces. This makes "snapping" players tokens to the spaces more difficult as well.

Any ideas on how to approach this concept? If the spaces were all rectangles and alinged in straight lines (like in Monopoly) I could program it fairly easily, but since Im looking at making something thats a bit more abstract in terms of its visuals, Im not sure how to approach the programming...

Help W/ Ship Movement (Building First Game)
Hey Everyone,

I was wondering if anyone could point me in the right direction for figuring out the movement of a ship in a game I'm building. Basically I want to ship to continuously move around on the stage, and head in whatever direction it's pointing in. Any links, etc.. would be greatly appreciated.

Any ideas?

Thanks,
Mike

Building An A3 Game In English And Spanish
I'm building a fairly in-depth online game for a client, and it has to be in both english and spanish. We're building the english version first. Only certain aspects will be affected by the spanish version: non-synched mp3 voice-over, some synched voice (probably embedded movie-clips with linkages), some text, and some of the buttons and splash screens. I'm trying to decide how to best structure the files to accommodate both languages, while at the same time trying to keep this from becoming 2 separate applications (to minimize effort as a result of change requests).

Does anyone have any suggestions? Even though much of the assets are common between the 2 programs, certain things are not. I don't want to get bogged down in code specifying which assets are and aren't shared, so I'm wondering if i need to have 2 of everything with a naming convention.

Or should I have a "shared" resource movieclip, a spanish resource movieClip, and an english resource movieClip and pull assets accordingly?

Any thoughts would be appreciated.

Dave

Getting Error Message After Building A Game.. Help Please?
I summed up my problem in the topic summary, I have been following a flash gaming tutorial and this is what I get 1026:constructor functions must be instance methods

Can someone explain what that means? I also will provide you with the code if asked :)

AS - Building A Bubble Puzzle Game
Hi people, I need to build a game that is similar to bubble puzzle game play, but have no idea how to start.

Try googling but didn’t get any useful result.

Anyone know of any tutorial or reference on when I can draw on to build a flash game around the same game play of bubble puzzle?


Thanks in advance!

Flex Or Flash - Building An Interactive Game.
What is the best IDE for building an interactive game using film clips and voice activation? I will need to randomly sequence film clips.
thanks

Flex Or Flash - Building An Interactive Game.
What is the best IDE for building an interactive game using film clips and voice activation? I will need to randomly sequence film clips.
thanks

Flex Or Flash - Building An Interactive Game.
What is the best IDE for building an interactive game using film clips and voice activation? I will need to randomly sequence film clips.
thanks

Building A Game Screen Based On XML Data
I am trying to position a list of movieClips on the screen using positioning data from an xml document.

I've created 2 movieClips in my library with the Class linkage of box01 and box02.

I have an xml document that describes the x and y coordinates I want to use:


<?xml version="1.0" encoding="iso-8859-1"?>
<data>
<art name="box01" x="50" y="50" />
<art name="box02" x="100" y="100" />
</data>

I am able to parse that xml document in flash and see the data:
trace(xmldata.art[0].@name) displays "box01"

Now I want to loop through the length of my xml "art" elements and build my screen (by calling the movieClips box01 and box02 that are in the library).

But I don't know how to use the name box01, box02 etc from the xml doc to create my instances.

This doesn't work, but more or less like this:

var i:uint;
for (i=0; i < xmldata.art.length(); i++) {
//trace(xmldata.art.@name);
var myMovieClip:[xmldata.art.@name] = new [xmldata.art.@name]();
myMovieClip.x = xmldata.art.@x;
myMovieClip.y = xmldata.art.@y;
addChild(myMovieClip);
}


Its this line that I need the syntax help on:

var myMovieClip:[xmldata.art.@name] = new [xmldata.art.@name]();


I want the name of my instances to be the "name" attribute from my xml doc.

I'm close - could someone please help me figure this out?

Thanks - I'll put my full code below.








----------------------------------------COMPLETE ACTION SCRIPT-----------------------

package {
import flash.display.*;
import flash.events.*;
import flash.net.URLLoader;
import flash.net.URLRequest;

public class myXMLDoc extends MovieClip {
private var xmldata:XML;

public function myXMLDoc() {
xmldata = new XML();
var xmlURL:URLRequest = new URLRequest("myXMLDoc.xml");
var xmlLoader:URLLoader = new URLLoader(xmlURL);
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
xmlLoader.addEventListener(IOErrorEvent.IO_ERROR,xmlLoadError);
}

function xmlLoaded(event:Event) {
xmldata = XML(event.target.data);
trace(xmldata.art[0].@name);
trace("Data loaded successfully.");
buildScreen();
}

function xmlLoadError(event:IOErrorEvent) {
trace(event.text);
}

function buildScreen() {
trace("building screen");
var i:uint;
for (i=0; i < xmldata.art.length(); i++) {
//trace(xmldata.art.@name);

//******This next line is where I want to add my movieClips box01 and box02 to the screen******
//******and use the x and y positioning data from the xml****

var myMovieClip:[xmldata.art.@name] = new [xmldata.art.@name]();
myMovieClip.x = xmldata.art.@x;
myMovieClip.y = xmldata.art.@y;
addChild(myMovieClip);
}
}
}
}

Building A Virtual Grocery Store Game
Hello,

So I am making a game grocery store where the items are movie clips and are draggable to a target called "box". I also have an input text box named "cost". I want it so that when each item lands on the target "box", the input text box says the total cost. The total, however, must be a running total so must add the price of the new item to the price of all other items that have entered the box.

If anyone can help me with this it would be greatly appreciated!!!

Thanks,
Lindsay

Needs EXPERT Help: 1. Save Game For Replay, 2. Reset Game
I'm rather new to Action Script, but doing not bad. I have searched the Board, found a link to a tutorial on ActionScript[Org], titled: "save a local copy of file". But that was yet not clear enough for me.

2 Questions at the moment (files attached):

1. Save Game for Replay: How can I save the set to a file in the Same Folder so it could reload for further play from that point on?

2. Reset Game: How can I Reset the Game for a NEW Attemp? I need to remove all Actors at once, to start a new game, without closing this SWF and reopenning it.

If you'd be so kind as to explain very clearly, and add Action Script, taking into consideration that I still get confused by trying to deal with Arrays and so. I promise to study your lesson carefully - this GameTest attached is the fruit of this week studies.

THANKS A LOT
Nit Kalish

Was This Game Made From Flash ? (Zadarider) Download The Game
Was this game made using flash 8 because it seems to run very well even when i have made up to 10000 lines.

Flash Game Help The Game Runs Too Slow In A Browser
lo there!
I'am so frustrated!

I have made a plattformgame in flash, and after I had published it I tested it (local) when it was embedded in a browser, and it hacks and laggs! But when I play it in the flash player it works just fine.
What should I do?

I removed all the heavy graphics, lowerd the fps to 30fps and removed all the code so now its just the bassis left (gravity, collision, key checking etc. and yes u should bounce on the walls giving a wall jump effect).

Anyone please! I am in big need of help!
Is it my code? Did I publish it wrong?

here are the links:

http://smh03.lbs.se/smh03niklas/prof...ofilbollen.swf
http://smh03.lbs.se/smh03niklas/prof...ofilbollen.fla
http://smh03.lbs.se/smh03niklas/prof...filbollen.html


//Qui

Nav Building - Help Me....
hia everybody,

i need some help in creating a nav in flash:

it should look like the nav in iriver.com

http://www.iriver.com/html/support/d.../sudw_list.asp

does anybody help me out with this and would create 2 or 3 nav buttons.

it would be great thanks alot..

adrian

Guy Building A Box ?
A long time ago I saw an intro of an anmited guy building a box ( on FK ), any Idea of where that movie is ?

Thanks guys !!

Building Over A .swf
Hey,

Was just fooling around with some flash stuff and was wondering: Is it possible to set your swf file as a background and build divs over it?

How To Disply Time In Game And How To Stop After The Game..
Hi all,

i need help on drag and drop game...

i have done the drag and drop function, for this game timer has to be shown, after user finishes the drag & match, it should give finish alert and time taken for this game (please tell me also how to stop time after he finish the game) is to be sent to some external file or some database...

can it be done?
i have attached the .fla file also..

[F8] Game Studio Needs Flash Game Programmer
Hi -

I've been working on cartoon Flash interfaces for awhile. Now my clients want games, so I'm looking for one or two Flash game actionscripters who can help out and maybe start a studio. Since it's a startup, I'm looking for someone who's good, but not yet making millions - hoping we can do that ourselves eventually. Someone dependable, easy-going and easy to get along with. Would be great to find someone relatively local, but not absolutely necessary.

We'll be creating custom Flash games for an existing client.

Hoping to check out people's games first.

J.

[F8] How Can I Make A Game With Levels And A Game That Restarts?
I know this sounds stupid, but I just can't figure it out. I need to make a platform game. I'm fine with making a points system and a scrolling background and it functions but I don't know how to get the player to touch an object, or reach a goal and then transport to another level...I don't want to make the user have to click something to go to a new level.

Also, when the character hits an enemy, I can make it die, but I don't know how to make a button or something appear saying 'Game Over - Try again', so they can pretty much restart the level.

Hopefully someone can help me.
Regards,
Andrea

Help With A Game.. Game Is Running Slow In Browser..
I am working on this game for work and for now all i have is placeholder art for the most part and nothing very heavy on the graphics end yet my game is running very slow.. i bumped the FPS to 60 since at 30 i was getting image tearing or a double vision effect.. the upped FPS fixed that but the game is still running very slow. To give you an idea of what's going on i have different intervals running so different things can happen at different times.. there are 2 constant onEnterframes for the 2 enemies flying around the screen.. there is 1 for the main loop, 1 for the character, 1 for whenever tickets generate which removes itself and deletes the enterframe when they disappear, 1 for the wrecks that occur on level 2 which also remove themselves and delete enterframes for themselves, and 1 for a holder that handles all the money flying in which removes themselves as they collide with the player or leave the screen. All enterframes that run during gameplay delete themselves at the end of each level and re-initialize at the beginning of the next.

I can't figure it out.. please take a look at the fla and html files attached. Could it be just the sheer size of the game screen.. should i make it about half the size?? I appreciate any help and thank you.

Also the game's scripted animations seem to be running a little choppy if you watch their movement closely like there is a little glitchy jump every second or so.. is this fixable?

AS Help Needed In Game(i Will Give Credit In Game If You Help)
ok so basicly this is my game so far
23.swf

my probelm is that i want to make my charcter a flame and the tips of his head will move depending on the direction you are going.
So here is basicly this what its like

Moving left-Flames bend to right
Moving left and down-Flames bend at an angle between the left and down
Moving Down-Shorter Flames
Moving Up-Stretched Flames
etc...

ill put borders on after i get the flames down

Building Dynamic MC -
Can someone point me to documentation on how I might dynamically build a movie clip via ActionScript.

Here's a summary of what I want to do -- build a list of buttons corresponding to a list of options that are provided by and asp page. These buttons will be contained within individual mc (each button has it's own mc) and then the 'button' mc are all merged into one MC that will be displayed in a floating window ---

any ideas?

Building Walls
I am working on a pac man type game where buttons move the main dude (mango). Can anyone tell me how to create barriers or walls that the dude can't go through?

Building A Mc List
here is my code

onClipEvent (enterFrame) {
_root.axt = "_parent.movier"+1;
trace(_root.axt);
axt.attachMovie("buttonone", "A"+1, +1);
axt.A1.texty = "words"+1;
_y = _parent.movier.A1.height+10;
}

basicly what im trying to do is build a script to populate a movie clip with a line of buttons.
each having its own instance name like a1, a2, a3, a3, a4,ect...
i could do this easily with generator but i need to use flash 6.
i really need help here!
if you want to see the fla ill post it.
please help!!

Building A Tsunami
Building a Tsunami
Author: Morten Barslund
_________________________________

I dont understand how i can add more text layers to the tsunami... I add one more and nothing happends to it, can anyone help me out plz

Help Building A Puzzle
Hi there,

I was looking for that kind of tutorial for so long. I'm trying to build a
puzzle game. Same kind as at http://www.shockwave.com/content/dailyjigsaw_syn/
where you can select the draggable object from anywhere whithin it's boundary.
Also, when the two object do overlap, they don't glue unless their in their good
position. It's not very easy but if you know how, give me a good hint

Regards,

Help With Building A Menu.
I am trying to build a menu that when you roll over a up or down arrow it will allow you to move a set of thumb nails up and down on the edge of the flash movie? is there a source that any one can point me to or help ne with building this menu. here is a link to a site that has an example of what i am looking for. http://www.jimerickson.com/mainframe.html

Site Building?
Hi all,

Im curious as to know if this site Im building is a good way to go about it.

http://www.media-power.co.uk/dande/

On this site,the pages are in different scenes all within the same swf file...the doors open...a button is clicked setting a variable name (e.g. About button sets variable to "about") and the scene plays on (doors close)...then last frame is an 'else if' scenario reading the variable set and therefore jumping to the right scene for the right page button clicked.

My question is...is this a good way to do it?...one whole swf could be a biggie to load....can I put preloaders before each scene?...should I be using the 'load movie' action instead for each page?..in which case, how do I get the buttons to know which page is open and which to load next after an outro of the page before has played?....should each page be a movie clip that loads when the buttons are clicked?

Basically whats the 'usual' way of building a flash site?

How are sites like http://www.estudio.com built?

Apologies for all the questions!

Thanks in advance

Andy

PS. My sites not finished yet!...only about and home are set up to work!

Building Txt With Newline
i want in a text field to write to each line something else!
is it possible to access eac line say with :
myTextField.line[1]="bla blo";

if not what else can i do?is there a possibility to access line and letters in each line?

is there a way to build a string that when i i replace a space with "newline" or something like that it will show :
"abc def"
and after it
"abc
def"
is this possible?then how?
thanks
Peleg

Help Building A Site (I'm New At This)
I was wondering if any of you experts can help me.

I am building a small site for my soccer team. It will be relatively simple with player pics & info and general team info and some links.

I have already made an intro movie (using some animations and music from flashkit).

Now HERE IS THE PROBLEM.

Unfortunately, I can't find the spare time to do this from scratch, and I do not know Flash well enough to be able to do it in the first place. What I am looking for is somewhere where I can download a FREE template and maybe edit it (change graphics etc...) and make it work for my particular site.

If anyone knows where I can find a template with a menu bar (preferably horizontal, but I'm not picky), and prehaps with some nice glide over or button click effects incorporated in it, I would really appreciate a link or two.

I would like the site to be an entirely in Flash, with the "frames" popping up within the "movie" once a button on the main menu is clicked (i.e. when "Player Bio" is clicked, it would load a pic with some text, which I will edit into the template).

So far, everywhere I've looked has only had templates for sale.

HELP PLEASE!!!

Thank you in advance...


P.S. I have MacroMedia Flash MX (Win 98SE)

Building A Jukebox , Help Plz
I'm trying to build a juke box in fmx,but am unsure of the best way to do this, i've started already but it takes an age for the audio
to DL before playing, what are the best compression ratio's for MP3
before it sounds rubish,whats better event or steam? wav or mp3?
or should foregt the whole thing and set it up so W/media player does
it instead, any help appreceiated
THX
J-x

Building Webpages In Different Res
i have been designing web pages for quite a long time but it was only this summer that i realised the problem of different screens resolution.so my question is this:i use dreamweaver and frontpage at work,and i would like to know how can i design the same page in both resolutions, 800*600 and 1024*768. i mean, do i have to change my screen's resolution and then make the page? is there anything,like an option or something, that does that?

thank you very much.

Component Building
Ok, I just finished building a flash application on the main timline of a movie. So I refer to _root a lot. I am now trying to conver this to a component, what should I replace _root with. In other words how do I refer to the component itself from any point in the hierarchy (eg within a class, or different symbols within flash).

Panning Up A Building
Thank you

Basically, Im trying to produce a building that gives the effect of scrolling up it in a game

Now I want rows of 3 windows that continually get produced, so they appear under the stage, then move up the stage, then get removed !

This will give the appearance of panning up the building.
so you get a grid like formation of windows in rows of 3.
Row appears, moves up, gets deleted

In these windows I will try and get different baddies to appear and do differnet things..(dont know how yet ???!!)

I could attach a sketch if it helps

Thanks again

Building Navigation
Hello All,

I was curious if anybody had any experience building a navigation that reacts like the one on http://www.squarewave.us. The collapsible menu on the left side.

Any examples or ideas from everybody would be great.

Thanks,
Brian

Building .exe Without Controls
I've got a completed movie and I want to make it an executable.

when I publish it as a projector .exe, I want to tell it not to loop the movie, and also to hide the menus at the top of the window (file, etc).

How do I do this?

Building Up A Circle
Hi guys, I was wondering it there's a tutorial or a movie example that explians how to draw, circles or lines or boxes, just using actionscript.

If there's any would you mind let me know?

T.i.a
Giano

Building Site
I was wondering if anyone could help me with something i see on all sites that i vist. So I'm thinking it cant be to hard to understand but then agian :P.

Heres what I'm trying to get when a flash site loads up for example ill use 2a agian http://www.2advanced.com/archive/v3/flashindex.htm in that site see how things load up i was wondering how they made it load up..... Im confused with the begging of the site. i have site made and done. I have screenshot of the layout :P

Another Thing that i was wondering is how to have the window in the middle thing load up without anything around it changing just that window loads up.
Any help or any sort of direction of were to start to learn this or anything i would really apperciate it.

Sounds confusing jsut re-reading what i wrote lol

Copyright © 2005-08 www.BigResource.com, All rights reserved