Creating a game with upgrades

13 posts

Flag Post

How would I go about creating a game where you can purchase upgrades or equipment that increase your effectiveness at something. such as increasing your attack power.

 
Flag Post

right now im currently in the design portion of my shop menu but i would just have like when you do damage to a monster:

originalDamage + upgradeDamage
or you could do
originalDamage*upgradeDamage

for the whole purchase thing you need a game state where the player is active in the shop and it builds the interface then. When you have stuff like equipment ot buy its different for every game. you could spawn it in or just equip upon purchase.
Also have to have currency in the mix.

 
Flag Post

Derp. Kong API forum to Game Design and then I moved it to Programming.

 
Flag Post

Thanks for the move, I don’t really know how these forums work so I just posted it. In response to redfawx I have it set up so the player does a random amount between minAttackDmg & maxAttackDmg. but I was really asking how I could get to shop in there and allow the player to buy upgrades to their weapon since I dont want to deal with creating multiple weapons. I would also allow upgrades to magic damage which is done in the same way. I’m also using AS2 so I’m not coding everything in one place its on the objects too. Thanks.

 
Flag Post

So you’ve got a minDamage variable and a maxDamage variable. Every time the player changes their weapon, set those variables to a new number.

 
Flag Post

I wouldn’t suggest modifying the stat directly on the player like that, since it opens up the possibility of corrupting character stats. Instead, I’d suggest storing the min/max damage values on the weapon itself. Then, when you go to attack:


public function getAttackDamage():int
{
  var damage:int;
  if (player.weapon == null)
  {
    damage = player.strength;
  }
  else
  {
    damage = Math.floor(Math.random() * (player.weapon.maxDamage - player.weapon.minDamage)) + player.weapon.minDamage + player.strength;
  }
  return damage;
}
 
Flag Post

Clever, I might try that. I’m not too worried about that yet but thanks alot I will probably use that or something similar later on :) I think I have an idea for the shop though, I think i’ll put it in a new frame and make some buttons that change your min and max damage, and change the frame of the weapon you use in the battle causing it to look different. this will make it appear like you upgraded your equipment in some way. also the only problem I see with your function is if you just use player strength with no weapon then you can only ever hit for one value. (I dont have a level up system or anything that would change strength.)

 
Flag Post

Also uhhh…. why is my name grey?

 
Flag Post

Because you’re the original poster in the thread.

 
Flag Post
Originally posted by Khronosis:

Because you’re the original poster in the thread.

So they make it invisible? lol okay.

 
Flag Post
Originally posted by torin555:

Clever, I might try that. I’m not too worried about that yet but thanks alot I will probably use that or something similar later on :) I think I have an idea for the shop though, I think i’ll put it in a new frame and make some buttons that change your min and max damage, and change the frame of the weapon you use in the battle causing it to look different. this will make it appear like you upgraded your equipment in some way. also the only problem I see with your function is if you just use player strength with no weapon then you can only ever hit for one value. (I dont have a level up system or anything that would change strength.)

How an individual developer chooses to calculate weaponless damage is up to them. I just put that in to fill the space, really.

 
Flag Post
Originally posted by Khronosis:

Because you’re the original poster in the thread.

So that’s what that means. Thanks for clearing it up!
 
Flag Post
Originally posted by Aesica:
Originally posted by torin555:

Clever, I might try that. I’m not too worried about that yet but thanks alot I will probably use that or something similar later on :) I think I have an idea for the shop though, I think i’ll put it in a new frame and make some buttons that change your min and max damage, and change the frame of the weapon you use in the battle causing it to look different. this will make it appear like you upgraded your equipment in some way. also the only problem I see with your function is if you just use player strength with no weapon then you can only ever hit for one value. (I dont have a level up system or anything that would change strength.)

How an individual developer chooses to calculate weaponless damage is up to them. I just put that in to fill the space, really.

Yeah, I wasen’t critisizing you or anything. I did end up using something similar to what you gave me but I did it to make animated floating damage text. It worked pretty well :)