FLASH GAME MAKER FAQ

5 min read

Deviation Actions

guzu's avatar
By
Published:
2.8K Views
Flash Game Maker: DOWNLOAD

Setup
Q:How do I add this to flash?
A:Few steps
a-download and unzip
b-open flash preferences
c-From Category, choose ActionScript and click "Action Script 2.0 settings"
d-Browse and choose the unzipped folder "myas2ext".

Q:I want to do a test that I correctly set it up
A:Try this
a-Make new flash file (As2)
b-Create a rectangle, select it and press F8
c-Tick [Export for ActionScript]
d-In the Class field, write guzu.game1.Room
If you get no error, you are good to go
-
If you want to test more, double click the room and:
-Create a rectangle and press F8, click export for actionscript
-In the Class field, write guzu.game1.Player
-Run it and control the player with right left up =>


[Player]
Q:I tried adding a second attack for player, but when I add the actionscript for the second combo using the combo setup.html, it will stop doing the first attack, and won't do the second one neither.
I also just want two attacks, one that executes with the "a" key and the second one with the "s" key if possible.
A:Make sure you add them in the same combo script, and not separately. Also, to add the s key, you need to add the keys configuration at the player setup.html

[Monsters]

Q:Is it possible to prevent monsters from bouncing back?
A:To prevent them from bouncing back, write in the first frame:
onDamage=function(attack){
return {go_back:false};
}
you can find the rest of them in the player.txt, last section.
-----
Q:Is it possible to add something like a visual range for monsters, so that at the begining, not ALL monsters go directly to the player?
A:It depends on you how you program the AI. But if you use the [attack and run.txt] file, you need to modify it a bit. Change:

start:function(){
ai.f.gotoPlayer();

to

start:function(){

if (ai.f.distanceToPlayer()<200) ai.f.gotoPlayer();

you can replace the 200 with anything you want.

-----
Q: I want to know if it is possible to add up to two or three attacks to a monster enemy.
A:There are many ways. But the simplest is just to add in the first frame of the attack:
if (Math.random()>0.5) this.gotoAndPlay("AttackA");
else this.gotoAndPlay("AttackB");
Note that this might be a bit buggy. Tell me if you face anything.
Or you can just randomly execute different combo setup function whenever random is called.

[Room]
Q: I couldn't pause the game since I don't know how to add the "pause()" and "resume()" functions. Do I have to just write that in the first frame of the room movieClip?
A:Here is an example of pause and resume buttons: www.box.com/s/3a019efbac0f8183…
The pause() and resume() functions are Room functions. Read Room.txt for the rest of the functions.
Also, Room functions can be called from within actors and players through the reference screen. So you can write screen.pause();
-----
Q:I've noticed that after adding a limit object into the room, the camera will follow the character, but the character will be at the middle of the y axis, and I wanted to know if the character could be a little lower in "y" so that there is more "air space" for the life bar and background.
A:You can simply place a movieClip of class Actor inside the player and call it "followme". And then, in the first frame of player, write:
screen.follow(followme);
Can be found in the Room.txt file
-----


[MISC]
Q:how to create a "GO>" like sign that appears when you clear an area just as in one of your games: guzu.deviantart.com/art/Art-Tr…
A*:This might be the least prepared thing, but there is a trick.
On the Wait object, add the following in the first frame:
//
onStart=function(){
screen.goSign.play(); // or maybe _parent.goSign
}
//
Make a GO sign, and in the properties, make instance name goSign.
Make last frame of Go sign empty and add stop();
-----
Q:I managed to do the GO sign, and it works fine, but I have the problem that if remains in the stage and when you move, it does too, so I wanted to know if it was possible to make it static.
A:For the Go sign, you can use Background class. Background objects will move differently than the normal objects. And you can set their speed to zero so they follow the screen.
-----
Q:How can I add a life bar?
A:The player contains a variable called status["hp"]. So, if your player is called Player1, you can read its hp using Player1.status["hp"].
-----
Q:I did an item that heals the player, using guzu.game1.Attack, just as you did in the tutorials in the Examples folder. But I wanted to know if it was possible to make enemies actually drop items, and again, modify how often that would happen, like a random happening.
A:You can simply use create(item1,0,0) to make monster create item1. You can find this command in Actor.txt
To create the item when a monster die, you need to add a die frame and put the create in the die frame. You add a die frame exactly like you add the walk frame.


* answers with star need revising
Thanks to Shi-Gu suggestion, I'll try to use questions to build up an FAQ for this Flash Game Maker.
© 2012 - 2024 guzu
Comments14
Join the community to add your comment. Already a deviant? Log In
Shi-Gu's avatar
Glad to see you managed to compile the questions in this FAQ :D

I've got some feedback on the lastest ones and a couple more questions.

:bulletblue: I used the Pause example you sent me and worked fine; Still had troubles adding the pause screen and that, but I think I'll leave it as the freeze kind for now.
:bulletblue: For the "air space", I did create the actor inside the player movieclip and added the code you told me in the first frame of the character. Named the actor class symbol "followme" and all. But the camera still won't follow this new symbol, making the player able to jump behind the life bar and the stuff I have on the top left corner. I noticed the Camera follows the player in the x axis, but when jumping, it won't go up with the player.

About the rest of the answers you gave me, I'll try to test a few more of them soon and some others will be used in a later game, but for now, I've got a couple new questions:

:bulletorange: I added some kind of sign post in the stage, that when you aproach it, pops up a message with instructions about how to move, attack, etc. I made it an Attack Class movie clip, set damage to "undefined" and when it hits the player, it will play the clip, showing the message. However, it will only work once, so when the time is over, the message will disappear, but won't pop up again. I tried to make the hit count higher, but it will keep going down as long as the player is being "hit" by it.
I wanted to know if there was some easier way to do this kind of messages pop up when you aproach the movieclip, that it pop ups as much times as you want, and that it disappears when you get away.

:bulletorange: I also noticed that when you enable platforms to be true, when the player or monsters die, their corpses will slowly slide on the stage until they disappear. I tried making platforms false in the frame they die, but if the monster originally spawned at a higher or lower leven than the place it died, the corpse will return to the original spawn "y" axis. Is there a way to stop them from sliding?

:bulletorange: About cutscenes being in the middle of the game but keeping life bars intact during the cutscene. I still don't know how to achieve this and I would highly apreciate if you could help me specially with this over the rest of my questions.

That would be all for now, and sorry for the delay with my feedbacks!
Thanks for all your support :D