Home  | Login  | Register  | Help  | Play 

RE: Flash Q&A Thread 4

 
Logged in as: Guest
  Printable Version
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A Thread 4
Page 10 of 30«<89101112>»
Forum Login
Message << Older Topic   Newer Topic >>
9/20/2007 17:15:19   
EragonZZZZ
Member

Gladly, although I'm more of one who answers questions then someone who teaches outright. So ask away! (note I may take awhile to respond, but I WILL)

by the way...

flsg = male. I'm pretty certain. A Fae avatar does not a female make.
AQ  Post #: 226
9/20/2007 18:43:42   
SirSchmoopy
Banned Multi


Eragon: Can u teach me globals???
flsg: can u teach me globals???
ion: can u tea-
nvm....
sombody: can u teach me globals???
any1 here: can sumbudy plz teach me globals!!!

_____________________________

Sig deleted.
Post sig only once per page.
Post #: 227
9/20/2007 19:05:57   
EragonZZZZ
Member

No, it's a bad habit to get into using them.
AQ  Post #: 228
9/20/2007 20:32:06   
SirSchmoopy
Banned Multi


but i need it for the xp system in my bunny game "hare one day, gone the next" it's turn based so i need to find a good xp system.

_____________________________

Sig deleted.
Post sig only once per page.
Post #: 229
9/21/2007 6:02:32   
The Illusive Man
Member

Sir S - They wouldn't teach me how to make globals either. But i shall find out lol
Post #: 230
9/21/2007 7:49:21   
SirSchmoopy
Banned Multi


lol.
btw, althorne, can u add me to the list of flash users, since i wuz talking on the flash Q&a since half way through the third 1.

_____________________________

Sig deleted.
Post sig only once per page.
Post #: 231
9/21/2007 9:11:07   
The Illusive Man
Member

done old chum lol
Post #: 232
9/21/2007 10:32:52   
ion24
Member

Mind adding me too? And althorne Check Your tut i asked you a Question.

@Eragon: Ok, If you look at the Game i linked back on Page 9, you can see what i want to do, But first i want to know How do i Make an HP-MP Kind of Battle Bar? It's not a turn-Based Game, But like the one i linked.

_____________________________

AQ MQ  Post #: 233
9/21/2007 13:42:30   
SirSchmoopy
Banned Multi



quote:

ORIGINAL: ion24

Mind adding me too? And althorne Check Your tut i asked you a Question.

@Eragon: Ok, If you look at the Game i linked back on Page 9, you can see what i want to do, But first i want to know How do i Make an HP-MP Kind of Battle Bar? It's not a turn-Based Game, But like the one i linked.

even tho i hate telling peeople Action script:
make a variable called HP
put the action in the timline: HP = 100;
now make a bar called health. put 100 frames, and on the first 1 make it blank, on 100 make it full.
now make a motion tween.
add this to the health:
onClipEvent (load) {
function reset() {
_root.health.gotoAndStop(_root.HP);
}
reset();
}

_____________________________

Sig deleted.
Post sig only once per page.
Post #: 234
9/21/2007 15:52:01   
flsg
Member

OMG, why does everyone ask what's global? Isn't it obvious?! Global variables are GLOBAL, they can be accessed from ANYWHERE in the movie

BTW, for those who doesn't know, a normal variable can't be accessed everywhere -.-
AQ  Post #: 235
9/21/2007 16:12:24   
SirSchmoopy
Banned Multi


flsg, dont get so pissed, sheesh. i just wanna kno how to use it, either that, or i need to find a diff way for the EXP system in my game.

_____________________________

Sig deleted.
Post sig only once per page.
Post #: 236
9/21/2007 16:18:31   
EragonZZZZ
Member


quote:

ORIGINAL: ion24

Mind adding me too? And althorne Check Your tut i asked you a Question.

@Eragon: Ok, If you look at the Game i linked back on Page 9, you can see what i want to do, But first i want to know How do i Make an HP-MP Kind of Battle Bar? It's not a turn-Based Game, But like the one i linked.


Uh, you can do sir Schmoopy's method if you absolutely want to.
But I suggest this:

Create two MCs, both rectangles. Call one 'healthbar' and one 'healthcontainer'. Decorate them if you want, then move them around so healthbar completely covers healthcontainer.

then...

Declare a variable 'HP' that is a number representing the player health
var HP:Number = 100;

and a variable called maxHP
var maxHP:Number = 100;


Note that the value of maxHP can be anything, as can the value of HP, but it would look nicer if the value of HP and maxHP were the same.

Then do some simple mathematics:
_root.healthbar._width = 200 * (HP/maxHP);


200 should be the maximum width of the healthbar. What this code does is get the fraction of your HP remaining out of the total and sets the bar to the same fraction of the total bar width. Rather flexible code; all the numbers can be easily changed to experiment with things.

so now we have (put this on the first frame of your game):

1: var HP:Number = 100;
2: var maxHP:Number = 100;
3: 
4: function onEnterFrame()
5: {
6:      //your code for the game here
7:      
8:      _root.healthbar._width = 200 * (HP/maxHP);
9: 
10:     //more game code here
11:}


To analyze the technical aspects of this code (syntax and whatnot):

Lines 1-2: These declare a variable, an allotment in memory that stores a specified value. 'var' is the declaration keyword, 'HP' is the name of the variable, and 'Number' is the type. The '=' operator sets it equal to that value.

Lines 4-5: Starts a function called onEnterFrame() that runs every time that frame is entered. Similar to the 'main' method in Java.

Line 6+10: Comments

Line 8: '_root.healthbar' tells the Flash Player to look at the movieclip on the _root named 'healthbar'. As you can guess, '_width' accesses the movieclip's width property, in pixels.

Note that brackets denote all the code that applies to the function. They are required.
AQ  Post #: 237
9/21/2007 16:28:50   
SirSchmoopy
Banned Multi


eragon: can u help me a bit?
i've tried every single frickin way i can think of i cant find any way at all to make an xp system!!! its drving me crazy!!!!! i cant even find the frickin chicken anymore to put in my retarded posts!!!! i need to get sumtin to work!!!! i havent had a working game without synatx erorz in dayz!!!!!!!!!! ChIcKen?!?!?! CoW?!?!?!?
DUCKY!!!!! !!!!!!!

< Message edited by SirSchmoopy -- 9/21/2007 16:41:08 >


_____________________________

Sig deleted.
Post sig only once per page.
Post #: 238
9/21/2007 16:48:18   
EragonZZZZ
Member

umm...declare a variable called 'playerXP' and 'levelXP'...then increment playerXP whenever you need to add XP.

Also, after XP is gained, check if playerXP == levelXP to see if it's time to level up; if it is, set playerXP to 0 and increase levelXP.

You don't need to use globals, since all your code should be in one place.
AQ  Post #: 239
9/21/2007 17:31:52   
somebody621
Member

You don't need to learn about globals - just how to get around them... Cause globals suck and are buggy and suck and are buggy.
Post #: 240
9/21/2007 18:47:23   
ion24
Member

Um... Eragon i'm trying to Learn This piece by piece, so i don't have a full version of my game, i have an idea for it. i Still don't know how to make a Stinking Character even. And how does the Magic Wand work? it's differant from Gimp's Magic Wand...
AQ MQ  Post #: 241
9/21/2007 19:38:30   
SirSchmoopy
Banned Multi


quote:

ORIGINAL: EragonZZZZ

umm...declare a variable called 'playerXP' and 'levelXP'...then increment playerXP whenever you need to add XP.

Also, after XP is gained, check if playerXP == levelXP to see if it's time to level up; if it is, set playerXP to 0 and increase levelXP.

You don't need to use globals, since all your code should be in one place.

wut duz increment mean
edit: nvm, i got it, but when i say to add 5 exp, after 2 times, its 55....

< Message edited by SirSchmoopy -- 9/21/2007 21:31:16 >


_____________________________

Sig deleted.
Post sig only once per page.
Post #: 242
9/22/2007 9:21:55   
The Illusive Man
Member

This is for everyone. Believe it or not, i agree that globals shouldn't be relied on too much. But i have the code for AS2

But knowledge is power. For the benefit of all I won't post it here, but if you want it PM me.

Post #: 243
9/22/2007 15:39:16   
somebody621
Member

YAY! I regained my flash mojo! I'm starting on a scrolling engine using supertiles (http://www.strille.net/tutorials/part1_scrolling.php) and Flash 8's bitmapdata.
Post #: 244
9/23/2007 12:36:34   
ion24
Member

Eragon, i'd like you to observe This Game For a week, When you've Completly Understood the iner Workings of it, Make a tut on how to make a game similer to that one, (But not Exactly THAT game, Just how to make characters, levels, character Selection screens and the like.) So you aren't Hit with a thousand Questions(Mostly by me).

@Somebody: Good for you!
AQ MQ  Post #: 245
9/23/2007 14:22:21   
EragonZZZZ
Member

Uh...
um...
That's not possible. I have school and dozens of other things I need to do.

If I EVER had that much free time, I'd be spending it on the game I'm trying to create. Not that I don't want to help you..but..for serial...thats crazy.
:P
AQ  Post #: 246
9/23/2007 17:37:59   
flsg
Member

if he decompose the game and make a tutorial then what's your point of copying the exact same thing?

< Message edited by flsg -- 9/24/2007 18:06:21 >


_____________________________

My flash gallery
my game thread

flsg, proud old member of AQ(still playing :O)
AQ  Post #: 247
9/23/2007 18:20:23   
ion24
Member

@Eragon: What i meant was that you don't do it all at once, but in bits and Pieces. And the week thing was all i could think of...

@Flsg: My Point was that i'm making a game and have no clue what i'm supposed to do, so i tut was the best thing i could think of, plus i WAS goning to say that You And Eragon could work on it Together.
AQ MQ  Post #: 248
9/23/2007 20:15:24   
EragonZZZZ
Member

A combination of scripting and animation bring you this:

http://img521.imageshack.us/my.php?image=nativeamericaneffectsvs7.swf
AQ  Post #: 249
9/24/2007 17:23:40   
SirSchmoopy
Banned Multi



quote:

ORIGINAL: SirSchmoopy

quote:

ORIGINAL: EragonZZZZ

umm...declare a variable called 'playerXP' and 'levelXP'...then increment playerXP whenever you need to add XP.

Also, after XP is gained, check if playerXP == levelXP to see if it's time to level up; if it is, set playerXP to 0 and increase levelXP.

You don't need to use globals, since all your code should be in one place.

wut duz increment mean
edit: nvm, i got it, but when i say to add 5 exp, after 2 times, its 55....



_____________________________

Sig deleted.
Post sig only once per page.
Post #: 250
Page:   <<   < prev  8 9 [10] 11 12   next >   >>
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A Thread 4
Page 10 of 30«<89101112>»
Jump to:






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