Kloucek888
12-07-2008, 04:43 PM
Sorry for the misleading title, but i got three questions, and didn't really wanted to describe them all in one bug title.
+ i'm a total rookie, so the su subject fits ;)
First
I want to make a game similar to: http://www.kontraband.com/games/14242/1-Out-Of-24/
I'm stuck on putting the tiles on the stage. So i want to make a grid of 24 tiles (6 by 4) with one them being different from other.
Putting tiles on a stage is easy:
package {
import flash.display.*;
public class odd_game extends MovieClip {
public function odd_game():void {
var tiles:Array = new Array();
for (var i:uint=1 ; i<=24 ; i++){
for (var x:uint=0 ; x <6 ; x++ ){
for (var y:uint=0 ; y<4 ; y++){
tiles.push(i);
var c:Tile1 = new Tile1();
c.stop();
c.x = x*63;
c.y = y*63;
addChild(c);
}
}
}
}
}
}
It makes a nice grid of multiplied movie clip showng the first frame. I want one (random) of those clips show the second frame of the mc. And of course add a different listener to it. No idea how :/
Second
More of a teoretical question. What is the best way to add timer to the game? I mean i added a most basic one with a bar animation but it doesn't count the time perfectly. If the computer is becoming slow the time is being counted erraticly (what i can see on the animation).
Can i just make a tween (showing the disappearing progress bar) lasting for 720 frames (one minute with 12fps) and just add a stop() at the end of it? Or is there a better (proper) way of doing it?
third
My application will consist of 4 minigames. There will be scoring involved, some data bases (to compare scores) etc. What, according to You guys is the most efficient way of putting this kind of application together (it's a group project)? Making a different .swf file for every part, or putting it all in one file?
That's it (so far, i'm sure i'll be here more often before the deadline). It's a school project, and my first pretty big one with flash/as3. Please tutor me;)
+ i'm a total rookie, so the su subject fits ;)
First
I want to make a game similar to: http://www.kontraband.com/games/14242/1-Out-Of-24/
I'm stuck on putting the tiles on the stage. So i want to make a grid of 24 tiles (6 by 4) with one them being different from other.
Putting tiles on a stage is easy:
package {
import flash.display.*;
public class odd_game extends MovieClip {
public function odd_game():void {
var tiles:Array = new Array();
for (var i:uint=1 ; i<=24 ; i++){
for (var x:uint=0 ; x <6 ; x++ ){
for (var y:uint=0 ; y<4 ; y++){
tiles.push(i);
var c:Tile1 = new Tile1();
c.stop();
c.x = x*63;
c.y = y*63;
addChild(c);
}
}
}
}
}
}
It makes a nice grid of multiplied movie clip showng the first frame. I want one (random) of those clips show the second frame of the mc. And of course add a different listener to it. No idea how :/
Second
More of a teoretical question. What is the best way to add timer to the game? I mean i added a most basic one with a bar animation but it doesn't count the time perfectly. If the computer is becoming slow the time is being counted erraticly (what i can see on the animation).
Can i just make a tween (showing the disappearing progress bar) lasting for 720 frames (one minute with 12fps) and just add a stop() at the end of it? Or is there a better (proper) way of doing it?
third
My application will consist of 4 minigames. There will be scoring involved, some data bases (to compare scores) etc. What, according to You guys is the most efficient way of putting this kind of application together (it's a group project)? Making a different .swf file for every part, or putting it all in one file?
That's it (so far, i'm sure i'll be here more often before the deadline). It's a school project, and my first pretty big one with flash/as3. Please tutor me;)