Home  | Login  | Register  | Help  | Play 

RE: I'd like to learn how to make flash games

 
Logged in as: Guest
  Printable Version
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: I'd like to learn how to make flash games
Page 2 of 2<12
Forum Login
Message << Older Topic   Newer Topic >>
3/14/2007 18:55:00   
EragonZZZZ
Member

Oh, sorry if that confuselyed you. It confuzles most peoples ^^

Basically, what you want to do then is put the battle engine in a single MC and whenever there is a battle, just use
attachMovie()
and attach the movieclip to the stage! YAY!
AQ  Post #: 26
3/14/2007 19:40:06   
Shad0wdrag0n
Member
 

@petermaxo - It still doesn't seem to be working. OK, I have 4 frames, each one a keyframe. On frame 1 I have var1=100. On frame 4 (the frame with the object) I have
if(player.hitTest(object)){var1=0}
_root.object._alpha=var1
All actions are on the frames themselves, not on any MCs. I've tried adding and removing _root. to various places but nothing seems to work. What am I doing wrong?

@EragonZZZZ - I think I know what you're talking about. I haven't done anything with attachMovie but I'll take a look at it and see if I can figure it out.
Post #: 27
3/14/2007 21:45:02   
Shad0wdrag0n
Member
 

Here's something I don't understand. I've linked some dynamic text to a variable. When the variable is changed the change is permanent. I've linked the alpha of an object to a variable. When the variable is changed the change isn't permanent. Is this normal? Both variable are on the first frame. The dynamic text and the object are both on seperate frames.

< Message edited by Shad0wdrag0n -- 3/14/2007 22:42:59 >
Post #: 28
3/14/2007 22:35:07   
EragonZZZZ
Member

Um, for the text field, what exactly is the code you are using? Changes shouldn't be permanent, hence the name "Variable"....I wonder what went wrong.

As always, happy to help. Just post your code!
AQ  Post #: 29
3/14/2007 23:10:58   
Shad0wdrag0n
Member
 

quote:

ORIGINAL: EragonZZZZ

Um, for the text field, what exactly is the code you are using? Changes shouldn't be permanent, hence the name "Variable"....I wonder what went wrong.

As always, happy to help. Just post your code!


On the first frame I have enemyStamina=0
Each enemy has if(this.hitTest(_root.player)){_root.enemyStamina=#}
# equals the amount of hit points the enemy has.
The dynamic text is in an MC and has it's Var set to _root.enemyStamina
When the player contacts the enemy it sets the dynamic text to #. When the player jumps to a different frame and then comes back the dynamic text still shows as the # value.

Maybe I should find a place to post the .fla file so you guys can take a look and let me know what it is I'm doing wrong?

< Message edited by Shad0wdrag0n -- 3/14/2007 23:24:07 >
Post #: 30
3/15/2007 8:30:11   
petermaxo
Member

I think you may be using '=' insteat od '==' somewhere. Also, though I'm not sure why you keep using _root., you need to add _global. to the variable name when you first define it to keep it constant (unless changed: then the new value is kept constant unless changed: then the new value is kept constant...) throughout all scenes, frames, etc.

at least, I think that may fix your problem.
AQ DF  Post #: 31
3/15/2007 14:09:14   
Shad0wdrag0n
Member
 

quote:

ORIGINAL: petermaxo

I think you may be using '=' insteat od '==' somewhere. Also, though I'm not sure why you keep using _root., you need to add _global. to the variable name when you first define it to keep it constant (unless changed: then the new value is kept constant unless changed: then the new value is kept constant...) throughout all scenes, frames, etc.

at least, I think that may fix your problem.


I tried adding an extra = to the hitTest part but it didn't work. I tried adding _global. to the variable but it didn't work. The code sets the alpha for the object based on the variable just fine (with or without the _global. part). The problem is that the hitTest isn't changing the variable when the player comes into contact with the object.

The reason I add _root. is because it doesn't work without it. EragonZZZZ's code for moving to different frames when the player contacts the edge of the stage (on the previous page of this thread) only worked when I added _root. a couple times. I tried removing all the _root. from your code and it still wont work.

< Message edited by Shad0wdrag0n -- 3/15/2007 14:35:10 >
Post #: 32
3/15/2007 15:47:28   
petermaxo
Member

Then I have no Idea what's wrong. sorry.
AQ DF  Post #: 33
3/15/2007 17:59:00   
EragonZZZZ
Member

Okay, this is important.

_root

and

_global

are VERY different. _root defines anything(a variable, movieclip, button) that is on the lowest level of the movie (as in, directly on the stage and not in a MC/symbol)
_global defines any VARIABLE that can be used throughout the movie.
AQ  Post #: 34
3/15/2007 18:13:42   
Shad0wdrag0n
Member
 

So, if
var1=100
if(player.hitTest(object)){var1=0}
object._alpha=var1
is supposed to work, what (if anything) should have _global. and what (if anything) should have _root.

I've tried it various ways but can't get it to work. Of course I may have missed a way (which will most likely be the correct way).

Is there another way to permanently remove a MC? In fact, is there a way to make any kind of change permanent or only occur once?

Like I said, I'm happy to provide a copy of the .fla I'm working on so you guys can see what (if anything) I'm doing wrong.
Post #: 35
3/15/2007 20:54:10   
Shad0wdrag0n
Member
 

Eureka, I figured it out!

On the first frame I put var1=100
On the fourth frame I put object._alpha=_root.var1
On the object MC I put
onClipEvent(enterFrame){
if(this.hitTest(_root.player)){
_root.var1=0;
this._alpha=_root.var1
}
}

Now when the player contacts the object the object turns invisible. When the player leaves the frame and comes back the object is still invisible.
Post #: 36
3/15/2007 21:10:40   
EragonZZZZ
Member

Congrats. Its so much better to teach onesself then to be taught, be cause then you completely (or almost) understand what'cha did!
AQ  Post #: 37
3/15/2007 21:30:56   
Myhos
Member

you can also you can get rid of a mc by using:

unload();

ex:

if(blah ==blah){
_root.mc.unload();
}
AQ DF  Post #: 38
3/15/2007 23:14:41   
Shad0wdrag0n
Member
 

One problem solved, onto the next. One problem I've recently run into is how to make an action occur once and only once. For example, say I have a treasure chest. When the player contacts it he gets some gold. What I want is for this to only occur once so the player can't just move away then move back into contact with the chest to get more gold. I've been trying to find a tutorial for this but so far I haven't had any luck.

< Message edited by Shad0wdrag0n -- 3/16/2007 3:43:12 >
Post #: 39
3/16/2007 17:05:27   
petermaxo
Member

one thing you could do is make a variable called 'chest1', set it to 0, and when the player opens the chest, set it to 1. Say in the script that gives the player the gold that it only gives them gold if chest1 = 0.
AQ DF  Post #: 40
3/16/2007 19:12:20   
Myhos
Member

you know you can just set it as True and False instead of the 1 and 0
AQ DF  Post #: 41
3/16/2007 21:03:21   
petermaxo
Member

How do you create a boolean variable?
AQ DF  Post #: 42
3/18/2007 22:13:49   
Shad0wdrag0n
Member
 

Does anyone know of some tutorials for creating a pop-up inventory with usable items (if such a thing exists)? Or could someone help me with making a pop-up inventory? The kind where you click a button and the inventory pops up, then you click another button to close it.

< Message edited by Shad0wdrag0n -- 3/19/2007 14:44:59 >
Post #: 43
3/21/2007 17:34:38   
Shad0wdrag0n
Member
 

What's it called when you can move the player behind and in front of an object (so the player can walk in front of a table and have it shown behind the player, or walk behind the table and have the table shown in front of the player)? I remember a tutorial about it but I can't remember where I found it. If I know what it's called maybe I can find it again. Does anyone here know what I'm talking about and can explain how to do it?
Post #: 44
3/21/2007 17:41:29   
VampireHSS
Member

Maybe the Flash Q&A thread could help you.
AQ DF MQ  Post #: 45
6/14/2007 23:17:29   
Boltis
Member

I'm Flash-retarded can someone help me. can some one tell me how to open a flash document. please i need help.
Post #: 46
6/14/2007 23:39:30   
ponycoltraine
Member

should be in the middle of the screen saying "flash document"
AQ  Post #: 47
Page:   <<   < prev  1 [2]
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: I'd like to learn how to make flash games
Page 2 of 2<12
Jump to:



Advertisement




Icon Legend
New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts




Forum Content Copyright © 2018 Artix Entertainment, LLC.

"AdventureQuest", "DragonFable", "MechQuest", "EpicDuel", "BattleOn.com", "AdventureQuest Worlds", "Artix Entertainment"
and all game character names are either trademarks or registered trademarks of Artix Entertainment, LLC. All rights are reserved.
PRIVACY POLICY


Forum Software © ASPPlayground.NET Advanced Edition