I’m in need of some help… im creating a Game, simlilar to one of the games we have in the arcade Which is the chopper game- http://www.kirupa.com/forum/arcade.php?do=play&gameid=5 im just creating this game to have an idea about basic game development in flash… or maybe Cs3 i dunno… well if you can hit me up with some ideas… it would help me a lot… thanks peoples!
ok… this is way too hard…
all i got is the dopey mouse to click and and follow the cursor T_T i need some help again
Show your code so far. I know it’s hard at first but it gets easier. If you don’t find this fun then continuing on for you could be a real pain. Personally I love the challenge, and I love finding the solution myself even more.
That is a pretty simple game to create, even though I would suggest something even more rudementary for your first game. Remember that when you are referring to movie clips in actionscript you could do something like this.
helicopter_mc.onEnterFrame = function () {
this._y += 5; // ' this ' is referring to helicopter_mc
}
Basically what this code does is make your helicopter go down by 5 on the y axis every frame; making it look like it is falling.
When you create the movie clip click export for actionscript -> click okay. Then when it is on the stage select it. Under properties at the bottom there will be a little text box called instance name. Make the instance name helicopter_mc.
That’s all I’ll say for now. I would like to see you make some progress.
PS. Flash 8 is ActionScript 2.0
That game sucks…
Anyway. Besides the code t0w put above, which drags the chopper down:
helicopter_mc.onEnterFrame = function () {
this._y += 5; // ' this ' is referring to helicopter_mc
}
You’ll need something to make it go up on mouse click and something to move the obstacles (or background graphics).
Here is a crappy simple example just to help you start. =)
holy crap… thats just awesome lol i was actuly looking for a code of that kind, you made that kind of code on the top of your head right?.. anyway, i didnt know how to set varibles, i think i got the hang of this but i dont understand what the t0w is
but anyway thanks thats exelent help =]
edit : ill upload some of the progress later
t0w is the guy who answered before setting the gravity.
alright i know this is dopey but, can u show me a tutroial from making this code and how everything works with intrinsic coding? but also add where the helicopter goes too low down or too high up, it skips to the game over frame? it might be asking a lot but…
I tryed doing this actions script again and tryed adding objects and puting a more wider stage that your one you currently done and i tried such as adding another cloud but it didnt work for me and its getting harder lol dayum…
and i think this code moves the clouds am i right?
onEnterFrame = function() {
if (isFlying) {
helicopter._y -= power;
gravity = 0;
} else {
gravity += gravInc;
helicopter._y += gravity;
}
for (i = 0; i < 2; i++){
if (this[‘cloud’+i]._x >= -this[‘cloud’+i]._width){
this[‘cloud’+i]._x -= speed;
} else {
this[‘cloud’+i]._x += Stage.width + Math.floor(Math.random() * 5 + 1) * Stage.width;
}
}
So if i wanted to add somthing i would change the instance name and create a new movie clip and rename where ever it says cloud to the new instance name? such as i want to add in… hmmm lets say a rock but going at a different XY speed but like faster than the clouds and the heli would be able to hit it, or somthing i would use that code am i right?
also points but well get to that later anyway thanks x]
I am the t0w.
Show isFlying
and use code tags
Eh? lol
Hi jaydee,
In fact, as I said up there this “is a crappy simple example just to help you start”. It was not made to be flexible to allow adding other elements, etc. You can add extra clouds by including them with names similar to the ones I made (cloudX), but I’d suggest you to do that using attachMovie instead. Also, you’ll have to change that “magical number” 2 in the line “for (i = 0; i < 2; i++){” to the total number of clouds, which I suggest should be a variable instead of a hard-coded magical number as I did for the example. Something like:
var cloudsTotal:Number = 12;
// this creates the clouds
for (i = 0; i < cloudsTotal; i++){
_root.attachMovie('cloud', 'cloud'+i, getNextHighestDepth());
}
// this moves them
for (i = 0; i < cloudsTotal; i++){
if (this['cloud'+i]._x >= -this['cloud'+i]._width){
this['cloud'+i]._x -= speed;
} else {
this['cloud'+i]._x += Stage.width + Math.floor(Math.random() * 5 + 1) * Stage.width;
}
}
Note you must link the cloud Movie in the library and you should use something similar to this “Stage.width + Math.floor(Math.random() * 5 + 1) * Stage.width” to set initial y an y of each cloud inside the creation loop. Also, you can randomly set with and height of each cloud so it looks like you have different ones, instead of only the same cloud over and over.
eh? so ill have to change the 5 + 1 to create the different sizes of clouds and i wouldnt be able to create the obstacles, i would have to change the action scripting completely to add obstacles and limits where the heli could fly?
hmmmmm weird… lol
Hey! This was supposed to be an example to help you make your game… I’m not making it for you, and I could, because you ain’t ever learn anything if every time you need something someone just hands you some code, a class or whatever. Good luck!
yeah i guess soo ill give you some thingos when im got some progress working…
buts its weird aye… im already taking classes for this shiiiz
By class I mean code class like:
class nameOfTheDamnedClass{
yadda yadda;
}
But, if you’re taking classes on Flash/Actionscript, even better, you’re on the right way.