Welcome Forums Get help How do I make shops?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #21403
    BunnyFangz
    Participant

    So I was wondering if there was a way to create shops in your games, because I’m making a game and I really wanna create a weapons shop but I have no idea how, can someone help?

    #21465
    deWiTTERS
    Keymaster

    Do you have trouble with creating the visuals of a shop, or with making the screenplays to pay money and give the player something?

    #21500
    BunnyFangz
    Participant

    sorry for not replying sooner but I’m having trouble with the screenplay of the player paying for items and stuff

    #21586
    Comprehensible
    Moderator

    Hey, that’s chill! They can be a bit tricky.

    So let’s say you have a shop for armor. The shopkeeper asks the player if they want to buy armor for five gold, and the player responds “yes” or “no.” If they say yes, it checks if the player has enough gold or not. If you want to ramp it up a notch, give the player a token at the end of the interaction so they can’t buy the same armor twice. Here’s how that screenplay would play out:

    if hero lacks token “bought armor”
    (four spaces) NPC gives choices for “So kid, you wanna buy some armor? Only five gold!”
    (eight spaces) in case “Sure!
    (twelve spaces) if hero number of “gold” >= 5
    (sixteen spaces) NPC says “Alright! Here’s the armor, you can change in the back.”
    (sixteen spaces) hero max health increases with 25
    (sixteen spaces) hero receives token “bought armor”
    (twelve spaces) else
    (sixteen spaces) NPC says “Not enough gold, kid. Come back later.”
    (eight spaces) in case “No thanks.”
    (twelve spaces) NPC says “Alright, now go on yer way.”
    else
    (four spaces) NPC says “I’m all outta stock. Now scram!”

    NOTE: See the indentations I’ve set up? As you probably know, each one is extremely important. It won’t work without them. Also, make sure to establish that gold counter earlier in the game to give your players some loot. Happy coding, and best of luck on your game!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Get help’ is closed to new topics and replies.