RE: I'd like to learn how to make flash games (Full Version)

All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy



Message


EragonZZZZ -> RE: I'd like to learn how to make flash games (3/14/2007 18:55:00)

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!




Shad0wdrag0n -> RE: I'd like to learn how to make flash games (3/14/2007 19:40:06)

@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.




Shad0wdrag0n -> RE: I'd like to learn how to make flash games (3/14/2007 21:45:02)

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.




EragonZZZZ -> RE: I'd like to learn how to make flash games (3/14/2007 22:35:07)

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!




Shad0wdrag0n -> RE: I'd like to learn how to make flash games (3/14/2007 23:10:58)

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?




petermaxo -> RE: I'd like to learn how to make flash games (3/15/2007 8:30:11)

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.




Shad0wdrag0n -> RE: I'd like to learn how to make flash games (3/15/2007 14:09:14)

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.




petermaxo -> RE: I'd like to learn how to make flash games (3/15/2007 15:47:28)

Then I have no Idea what's wrong. sorry.




EragonZZZZ -> RE: I'd like to learn how to make flash games (3/15/2007 17:59:00)

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.




Shad0wdrag0n -> RE: I'd like to learn how to make flash games (3/15/2007 18:13:42)

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.




Shad0wdrag0n -> RE: I'd like to learn how to make flash games (3/15/2007 20:54:10)

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.




EragonZZZZ -> RE: I'd like to learn how to make flash games (3/15/2007 21:10:40)

Congrats. Its so much better to teach onesself then to be taught, be cause then you completely (or almost) understand what'cha did!




Myhos -> RE: I'd like to learn how to make flash games (3/15/2007 21:30:56)

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

unload();

ex:

if(blah ==blah){
_root.mc.unload();
}




Shad0wdrag0n -> RE: I'd like to learn how to make flash games (3/15/2007 23:14:41)

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.




petermaxo -> RE: I'd like to learn how to make flash games (3/16/2007 17:05:27)

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.




Myhos -> RE: I'd like to learn how to make flash games (3/16/2007 19:12:20)

you know you can just set it as True and False instead of the 1 and 0




petermaxo -> RE: I'd like to learn how to make flash games (3/16/2007 21:03:21)

How do you create a boolean variable?




Shad0wdrag0n -> RE: I'd like to learn how to make flash games (3/18/2007 22:13:49)

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.




Shad0wdrag0n -> RE: I'd like to learn how to make flash games (3/21/2007 17:34:38)

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?




VampireHSS -> RE: I'd like to learn how to make flash games (3/21/2007 17:41:29)

Maybe the Flash Q&A thread could help you.




Boltis -> RE: I'd like to learn how to make flash games (6/14/2007 23:17:29)

I'm Flash-retarded can someone help me. can some one tell me how to open a flash document. please i need help.[sm=sad-smiley-006.gif]




ponycoltraine -> RE: I'd like to learn how to make flash games (6/14/2007 23:39:30)

should be in the middle of the screen saying "flash document"




Page: <<   < prev  1 [2]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition
0.078125