RE: Flash Q&A Thread 4 (Full Version)

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



Message


EragonZZZZ -> RE: Flash Q&A Thread 4 (9/20/2007 17:15:19)

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.




SirSchmoopy -> RE: Flash Q&A Thread 4 (9/20/2007 18:43:42)

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!!!




EragonZZZZ -> RE: Flash Q&A Thread 4 (9/20/2007 19:05:57)

No, it's a bad habit to get into using them.




SirSchmoopy -> RE: Flash Q&A Thread 4 (9/20/2007 20:32:06)

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.




The Illusive Man -> RE: Flash Q&A Thread 4 (9/21/2007 6:02:32)

Sir S - They wouldn't teach me how to make globals either. But i shall find out lol




SirSchmoopy -> RE: Flash Q&A Thread 4 (9/21/2007 7:49:21)

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.




The Illusive Man -> RE: Flash Q&A Thread 4 (9/21/2007 9:11:07)

done old chum lol




ion24 -> RE: Flash Q&A Thread 4 (9/21/2007 10:32:52)

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.




SirSchmoopy -> RE: Flash Q&A Thread 4 (9/21/2007 13:42:30)


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();
}




flsg -> RE: Flash Q&A Thread 4 (9/21/2007 15:52:01)

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




SirSchmoopy -> RE: Flash Q&A Thread 4 (9/21/2007 16:12:24)

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.




EragonZZZZ -> RE: Flash Q&A Thread 4 (9/21/2007 16:18:31)


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.




SirSchmoopy -> RE: Flash Q&A Thread 4 (9/21/2007 16:28:50)

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!!!!!!!!!![sm=animal-smiley-077.gif] ChIcKen?!?!?![sm=chicken.gif] CoW?!?!?!?
DUCKY!!!!![sm=EvilEye.gif]!!!!!!!




EragonZZZZ -> RE: Flash Q&A Thread 4 (9/21/2007 16:48:18)

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.




somebody621 -> RE: Flash Q&A Thread 4 (9/21/2007 17:31:52)

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.




ion24 -> RE: Flash Q&A Thread 4 (9/21/2007 18:47:23)

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




SirSchmoopy -> RE: Flash Q&A Thread 4 (9/21/2007 19:38:30)

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




The Illusive Man -> RE: Flash Q&A Thread 4 (9/22/2007 9:21:55)

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.





somebody621 -> RE: Flash Q&A Thread 4 (9/22/2007 15:39:16)

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.




ion24 -> RE: Flash Q&A Thread 4 (9/23/2007 12:36:34)

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!




EragonZZZZ -> RE: Flash Q&A Thread 4 (9/23/2007 14:22:21)

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




flsg -> RE: Flash Q&A Thread 4 (9/23/2007 17:37:59)

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




ion24 -> RE: Flash Q&A Thread 4 (9/23/2007 18:20:23)

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




EragonZZZZ -> RE: Flash Q&A Thread 4 (9/23/2007 20:15:24)

A combination of scripting and animation bring you this:

http://img521.imageshack.us/my.php?image=nativeamericaneffectsvs7.swf




SirSchmoopy -> RE: Flash Q&A Thread 4 (9/24/2007 17:23:40)


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





Page: <<   < prev  8 9 [10] 11 12   next >   >>

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition
0.15625