Weapon Reward System With Points

TouchTiltGamesTouchTiltGames Member Posts: 1,162
edited November -1 in Working with GS (Mac)
I'm wondering what the best route is to take for a problem I need to solve:

I have a score system in place so when you hit an actor with one of the objects, you gain points, only I want to award more weapons/items to the player when they reach certain point intervals in the game - a reward system if you will.

So:

at 200 points you get X.Weapon
at 300 points you get X.Weapon
etc...

I was thinking that I just say on my points actor: If points attribute is greater than 100pts, spawn X.Weapon in a position. If greater than 200pts, spawn another Weapon etc.

I want to have all the weapons there on the HUD but greyed/locked until they reach the points. So could I get this job done just by using what I described above? Is it the best way to do this for a whole wack of guns/actors on the screen?

Thanks in advance :)

Comments

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    I think your method will work fine but you will need to elaborate your conditions a bit more.

    e.g.

    If score >99
    If score <200

    Spawn weapon

    Next

    if score >199
    If score < x

    etc etc

    On your greyed out actors, when score > x
    change image/alpha

    That should be fine
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Thanks Beefy, is changing the alpha on the locked items enough to switch them on/off?
  • quantumsheepquantumsheep Member Posts: 8,188
    Nope - you'd have to have a variable I reckon that says 'weapon x is on/off'.

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Cheers! :) I will give this a try (he says hesitantly)
  • quantumsheepquantumsheep Member Posts: 8,188
    How did it go?

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    QS: Got the spawning on if score number working great...Just not sure about how to turn the actor on/off with an alpha, yet still have it there with a 20% opacity but untouchable until you unlock it :p
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Shizane said:
    QS: Got the spawning on if score number working great...Just not sure about how to turn the actor on/off with an alpha, yet still have it there with a 20% opacity but untouchable until you unlock it :p

    When you "turn" actor on and off with alpha, all that does is make it transparent, so its still there you just can't see it.....

    To get to this go self.color.alpha

    if you put the alpha at 0 its transparent, if you put it at 1 you can totally see it......

    Soo if you wanted it at 20% enter .2

    Hope that helps! Good Luck!
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Ooooh yeah sorry I knew that, what I meant was to have the actor there but with some opacity and not clickable until you awarded it. This is probably with some interger attribute 0/1 trickery?
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Yes, thats what you'd do, or you could use a boolean....

    Just an example:

    So when game.score > 1000 change hidden actor to true, when hidden actor is true: do this

    Hope that helps, Good Luck!
  • quantumsheepquantumsheep Member Posts: 8,188
    The way I've done it with 2 Minute Tank is this:

    There are four 'special weapons' - let's call them W1, W2, W3 and so on...

    They can each be upgraded four times.

    So what I do is give each of those a starting value of 0.

    W1 = 0
    W2 = 0

    etc

    If the value is at 0, they are dormant. You cannot use them.

    If the value is 10, then they're at power 1.
    If the value is 20, then they're at power 2.
    If the value is 30, then they're at power 3.
    If the value is 40, then they're at power 4.

    So, in your case, you have your powerup at the start of the game at 0 (not working)

    When you reach a certain score, let powerup value = 10

    Get further, let powerup value =20

    That should help. Sorry if it confuses, it was made with a 'shop' in mind.

    Cheers,

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Yeh i would just have the alpha turned down so they look greyed out. Then create a rule that says when the score > than x and < than y then set self.alpha to 1 (on weapon icon) and change attribute weaponunlock (or whatever you call it) to x. Then this will control what icons are greyed out and what weapon you have unlocked. Hope that makes some sense?
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    You guys rock...thanks so much, such a great community here. I'll give this a try later and let you know.

    -shane
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Ok quick question, I'm close but how do I define that the actor/item is unusable other than creating a boolean? One thought is to have two actors - 1 is unmovable and has no rules on it, the 2nd one has the rules and gets spawned over top of it....

    There an easier more efficient way?
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Just add a condition to your Rule that checks the alpha of the Actor, like this:

    Rule
    When ALL conditions are valid:
    Touch is Pressed
    self.alpha = 1
    -----[do something]
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Got it! :) Thanks again guys! And I even did it with a few beers in me on a hot day lol
Sign In or Register to comment.