Forum Topic: As2: Sim Game. Help!!!

(144 views • 14 replies)

This topic is 1 page long.

<< < > >>
Misunderstood

PozioxD

Reply To Post Reply & Quote

Posted at: 6/27/09 09:03 PM

PozioxD NEUTRAL LEVEL 09

Sign-Up: 07/27/07

Posts: 17

Hello everybody,i'm making SIM game with HUNGER,HYGIENE etc. and i got here LOTS of PROBLEMS because i don't know AS perfectly...
So i need code (and explain please) for these things:
How to make:
-every (SOME NUMBER) second hunger+(SOME NUMBER)
-Max value of need = 100 and minimal = 0
-When my hero watching TV (is on a frame with TV) his fun gonna pull up every (SOME NUMBER) seconds by (SOME NUMBER)
-Max hitpoints = STR * 10
-Cash earned by working = INTELLIGENCE * (SOME NUMBER)

I hope you understand me... But i think you doesn't... :(
Please help fast...
Thank for everything.
P.S i'm using Flash CS3 (if it matter) and AS2 !!!!


None

Woadraiders

Reply To Post Reply & Quote

Posted at: 6/27/09 09:09 PM

Woadraiders DARK LEVEL 11

Sign-Up: 11/11/07

Posts: 561

At 6/27/09 09:03 PM, PozioxD wrote: -every (SOME NUMBER) second hunger+(SOME NUMBER)

Use a timer

-Max value of need = 100 and minimal = 0

Use an if statment

-When my hero watching TV (is on a frame with TV) his fun gonna pull up every (SOME NUMBER) seconds by (SOME NUMBER)

Use a timer

-Max hitpoints = STR * 10

Learn variables! >:(

-Cash earned by working = INTELLIGENCE * (SOME NUMBER)

Honestly, variables...


I hope you understand me... But i think you doesn't... :(
Please help fast...

Learn how to script

Thank for everything.
P.S i'm using Flash CS3 (if it matter)

Not really

Max hitpoints = STR * 10;

You can't figure out how to script this? If you can't do this then you need to learn the very basics of as2. Honestly, variables is like one of the first things someone should learn.

Mibbygames.com
panterA

BBS Signature

Mad as Hell

PozioxD

Reply To Post Reply & Quote

Posted at: 6/27/09 09:13 PM

PozioxD NEUTRAL LEVEL 09

Sign-Up: 07/27/07

Posts: 17

Maan! I know how to script! Max hitpoints = STR * 10; Doesn't working... -.- i'm not soo stupid.
USe timer? HOW?!


None

atomoxic

Reply To Post Reply & Quote

Posted at: 6/27/09 09:34 PM

atomoxic LIGHT LEVEL 10

Sign-Up: 02/16/09

Posts: 226

You obviously don't know how to script if you think Max Points = STR*10 as you can and never will be able to use spaces in variables.

It would be more like:

MaxPoints = STR*10;

He is right - you do need to learn the basics really.

BBS Signature

Elated

LuxGamer

Reply To Post Reply & Quote

Posted at: 6/27/09 09:37 PM

LuxGamer LIGHT LEVEL 07

Sign-Up: 05/31/08

Posts: 240

lmaoooooooooooooo

I'm pretty sure hes kidding. looll :)
this is going to be funny.

ain't about how hard you hit... It's about how hard you can get hit, and keep moving forward... how much you can take, and keep moving forward.

BBS Signature

Angry

PozioxD

Reply To Post Reply & Quote

Posted at: 6/27/09 09:40 PM

PozioxD NEUTRAL LEVEL 09

Sign-Up: 07/27/07

Posts: 17

#UP
What it's so funny -.-?

Most important is now how to use timer... I look for tutorial but anyone doesn't had it.

Stop laugh from me... I just want to learn-That's bad?


None

Woadraiders

Reply To Post Reply & Quote

Posted at: 6/27/09 09:58 PM

Woadraiders DARK LEVEL 11

Sign-Up: 11/11/07

Posts: 561

At 6/27/09 09:40 PM, PozioxD wrote: #UP
What it's so funny -.-?

Most important is now how to use timer... I look for tutorial but anyone doesn't had it.

Stop laugh from me... I just want to learn-That's bad?

No it's good, it's just you say you "don't know ASperfectly" but then didn't know about that rule with variables. It's fine though, no worries.

Here's a tutorial on how to use a timer,
http://www.republicofcode.com/tutorials/
flash/setinterval/

And here:
http://www.actionscript.org/resources/ar ticles/120/1/Intervals-in-Flash-with-set Interval/Page1.html

Annnd here:
http://livedocs.adobe.com/flash/8/main/w whelp/wwhimpl/common/html/wwhelp.htm?con text=LiveDocs_Parts&file=00001766.html

I don't blame you for not being able to find these, I had to search for as2 setInterval tutorial. I would absolutelyread the first link I gave you, the others are just good backups, and I think go more in depth.

Mibbygames.com
panterA

BBS Signature

Expressionless

PozioxD

Reply To Post Reply & Quote

Posted at: 6/27/09 10:07 PM

PozioxD NEUTRAL LEVEL 09

Sign-Up: 07/27/07

Posts: 17

Thanks! You help me alot... You're good man :P and you make my mood better,but just little.

I think i got LOOOooooong way to Flash PRO :PP ahhh dreams :P... I'm just 14 ;/ and i haven't ANY flash lessons only paint,ms word excel etc...


None

salted-tator-tot

Reply To Post Reply & Quote

Posted at: 6/27/09 11:27 PM

salted-tator-tot FAB LEVEL 30

Sign-Up: 02/26/06

Posts: 3,318

At 6/27/09 10:07 PM, PozioxD wrote: Thanks! You help me alot... You're good man :P and you make my mood better,but just little.

I think i got LOOOooooong way to Flash PRO :PP ahhh dreams :P... I'm just 14 ;/ and i haven't ANY flash lessons only paint,ms word excel etc...

If you really want to be a pro, learn As3 since you haven't learned As2 yet. The transition is harder than you might think.

01000100011000010110111001100011011 01001011011100110011101010000011010 01011011100110010101100001011100000 11100000110110001100101010001110111 010101111001

BBS Signature

None

Woadraiders

Reply To Post Reply & Quote

Posted at: 6/28/09 01:30 AM

Woadraiders DARK LEVEL 11

Sign-Up: 11/11/07

Posts: 561

I agree, but you've really gotta put time into it, and you might want to think about sticking with as2 until you learn the basics of programming. You won't get very far into actionscript 3's strict object oriented programming without at least knowing functions, hierarchies, and the ins and outs of variables.

So basically, I recommend knowing the basics before trying to learn actionscript 3, because my bet is you'll just get stuck and frustrated. Feel free to prove me wrong ;).

Mibbygames.com
panterA

BBS Signature

None

salted-tator-tot

Reply To Post Reply & Quote

Posted at: 6/28/09 03:49 AM

salted-tator-tot FAB LEVEL 30

Sign-Up: 02/26/06

Posts: 3,318

At 6/28/09 01:30 AM, Woadraiders wrote: I agree, but you've really gotta put time into it, and you might want to think about sticking with as2 until you learn the basics of programming. You won't get very far into actionscript 3's strict object oriented programming without at least knowing functions, hierarchies, and the ins and outs of variables.

So basically, I recommend knowing the basics before trying to learn actionscript 3, because my bet is you'll just get stuck and frustrated. Feel free to prove me wrong ;).

That's better :P
Definitely get the basics then work your way into As3. I'm not a great programmer, but then again, I'm too lazy to really put forth any real effort to learn anything too new.

01000100011000010110111001100011011 01001011011100110011101010000011010 01011011100110010101100001011100000 11100000110110001100101010001110111 010101111001

BBS Signature

Resigned

crapatflash

Reply To Post Reply & Quote

Posted at: 6/28/09 07:18 AM

crapatflash LIGHT LEVEL 12

Sign-Up: 12/15/06

Posts: 728

uh, i would guess that a sim game is way above your level. if you don't know AS that well, i would suggest something a little simpler to tackle.


None

crapatflash

Reply To Post Reply & Quote

Posted at: 6/28/09 07:20 AM

crapatflash LIGHT LEVEL 12

Sign-Up: 12/15/06

Posts: 728

At 6/27/09 11:27 PM, salted-tator-tot wrote: If you really want to be a pro, learn As3 since you haven't learned As2 yet. The transition is harder than you might think.

I used to think that (see earlier posts) but know that I'm using it i found it's actually not that hard.


None

Super-Yombario

Reply To Post Reply & Quote

Posted at: 6/28/09 12:24 PM

Super-Yombario FAB LEVEL 06

Sign-Up: 03/16/07

Posts: 1,174

That original post was so messed up I thought he was testing SQL at my first look O_O

Okay since I hate the idea of a new guy making something like this, I'll go ahead and say you should be able to make flash do at least SOMETHING dynamic before you try to do anything else in it.

But now I guess I'll help. Timer:

var timer:Number = 0;
time=function(var){
var secs:Number = 30;
while(secs>0){
secs--;
}
if(secs<=0){
secs=30;
var++;
}
}

Now, to call the function, type this under onEnterFrame so you don't have to keep typing all of that:

time(timer);

That should work, I dunno, I didn't test it.

RIP Ed McMahon - RIP Farrah Fawcett - RIP Michael Jackson
But wait, there's more...
RIP Billy Mays


None

Woadraiders

Reply To Post Reply & Quote

Posted at: 6/28/09 04:06 PM

Woadraiders DARK LEVEL 11

Sign-Up: 11/11/07

Posts: 561

I think a simple setInterval, clearInterval would be cleaner.

Mibbygames.com
panterA

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 06:33 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!