00:00
00:00
Newgrounds Background Image Theme

Sk8er-Gaius15 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Need help; Upgrading hero page

376 Views | 2 Replies
New Topic Respond to this Topic

Need help; Upgrading hero page 2015-09-14 08:38:44


I'm looking to make a game based on real life self improvement.

The hero is upgraded by things you do, building life skills, etc.

I don't know how to set up the variables and make them upgradeable. Can anyone help?


TheSilverSerpent: Kickin' it with a new kind of style.

BBS Signature

At 9/14/15 08:38 AM, TheSilverSerpent wrote: I'm looking to make a game based on real life self improvement.

The hero is upgraded by things you do, building life skills, etc.

I don't know how to set up the variables and make them upgradeable. Can anyone help?

I assume as3?

Set up variables example:

var strength:int = 0;

Increase variables:

function increaseStrength(inc)
{
strength += inc;
trace(strength) //Displays strength value in output box
}

You might want to have a button that when you press you increase strength.
Make a button in your flash document called "Button_1"

Button_1.addEventListener(MouseEvent.CLICK, buttonClick) 

function buttonClick(e:MouseEvent)
{
increaseStrength(5); //increases strength by 5
}

I suggest doing some javascript courses on codecademy that helped me getting started.

Response to Need help; Upgrading hero page 2015-09-14 22:43:01


At 9/14/15 04:24 PM, Maxiecole wrote:
I assume as3?

Set up variables example:

I suggest doing some javascript courses on codecademy that helped me getting started.

Thanks Maxicole, really appreciate it. Will list you in credits if I get this developed enough for Newgrounds.


TheSilverSerpent: Kickin' it with a new kind of style.

BBS Signature