PDA

View Full Version : Newb Game Developer who has a few questions


jeremycollins
09-28-2008, 01:38 AM
Hi! I am still working at designing games! I really want to make this a hobby, however I just do not understand "everything" pertaining to creating games in flash. Yes, I have created a few maze games and what not, but I want to start making really good games. I have a few simple "I think" questions which I would really like to get answers to, and I am sure they will aid me on my quest to becoming a successful flash game developer.

1. I see a lot of games that have random things...like one minute its a sunny day and all of a sudden, its storming and a tornado comes. How do they do this? Do they create thousands of key frames? And how do they make these things occur at random? I have yet to grasp this type of concept...making things occur at random.
2. How do you make things move such as with the mouse or arrow keys? If I create a character and called it boy_mc, how would I make boy_mc be controlled by either the arrow keys and the mouse?


Well, I think that will do for now, but I really need all the help I can get in understanding these types of things. Don't put me down because I am not a good flash person yet, but I do learn fast...as I know quite a bit about actionscript and the flash programs like Mac Flash Pro 8, which is what I have.

presodeminacion
09-28-2008, 04:31 PM
Hi jeremy ;)
1 - You are not a good flash person..., but me neather, but we care to be.

I recomend than start downloading games, read how they work, search in this forum, google , etc... so you can have a better idea of the facts and the ways to bring them. :confused:

I see a lot of games that have random things...like one minute its a sunny day and all of a sudden, its storming and a tornado comes. How do they do this? Do they create thousands of key frames?
Some crazy guy maybe do this( its factible too), But usually are used variables values with timers to change movieclips ( like weathers states or other else.). Logic ways to interpreter things.
And how do they make these things occur at random?
The language reference from flash its a good budy, help me create random values than i need.
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNum;
}
for (var i = 0; i < 100; i++) {
var n:Number = randRange(4, 11)
trace(n);
}


How do you make things move such as with the mouse or arrow keys?
Move things with the mouse, is so simple at starDrag include on your mc. Example.
onClipEvent (load) {
startDrag("", true, 50, 265, 650, 265);
}
Also, move with arrow keys its so simple as put this code on the actionscript line give to bouy_mc a limit of 645 in "x" to make this action, else if x is < to 645 "x" will move a "speed" value, in this example is 10... and only to RIGHT key... read about LEFT, SPACE BAR and other keys.
var speed:Number = 10;
boy_mc.onEnterFrame = function() {
if (Key.isDown(Key.RIGHT)) {
if (boy_mc._x<645) {
this._x = this._x+speed;
}
}
}


Hope this guide you better and keep learning=true;

Bye. :p