How to Make Item Locked Until Player Buys it?

Hey, I've made a coin system in my game and it works, but I wanted to add an option for the player to buy extra maps (not IAP, just with game money) so basically I'm not exactly sure on how to make a scene locked/unplayable until the character buys it. Does anyone know how to do this or have a video for it? Thanks!

Comments

  • SikkJewFroSikkJewFro Member Posts: 75

    So, Im assuming you mean they can not purchase the map until the unlock it for a certain price? Then once they pay the unlocking fee they can then pay to buy the actual island correct?

  • SikkJewFroSikkJewFro Member Posts: 75

    If so, what you can do, is make a square or rectangle to overlay ontop of where this upgrade/item is. Make the square/rectangle opaque so its invisable to the players eye.
    Click the object and do the following:

    Make a new rule.
    When touch is received, do:
    change attribute, "Players coins minus Price to unlock "
    And example of ^ that would be
    Change attrivute "balance - 100"
    That will deduct a certain price from the players balance once clicked.
    Then, also add a "destroy actor" attribute to the rule.
    This way, when the player clicks the box it will deduct the money and allow the player to click whatever was underneath it "The island". Id suggest taking a more complicated route to allow a popup message to be displayed.
    This way if the player accidentally clicks the area that would unlock said island, they can cancel.

  • firezombie444firezombie444 Member Posts: 49
    edited August 2014

    Ok thanks! I'm gonna try that tonight! Also one more question: How do you make a high score system on PC, I know how to do it on Mac but apparently it doesn't work the same for PC.

    Edit: I mean the load and save attribute behaviors apparently work differently from Mac and PC, the rest works fine.

  • personal foulpersonal foul Member Posts: 64
    edited November 2015

    Hi @SikkJewFro having a problem. i made an actor that looks like a lock and overlaid it over item. when i click over item the item works first before the lock image does. i went into scene and layered the lock in different places and still having same problem. any suggestions?

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited November 2015

    Show a screenshot of your code.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    The actor underneath the 'lock' will still receive the mouse click. (Both actors will receive the mouse click -- the bottom one first, and then the one on top.)

    You might want to think of a different way to lock an actor.

Sign In or Register to comment.