Author Topic: Shops in a Game  (Read 2787 times)

mccool

  • Regular
  • **
  • Posts: 48
  • That's like trying to eat a burrito with no fork!
    • View Profile
Shops in a Game
« on: 2006-07-01, 01:49:34 PM »
How do i make it so in my game there is some sort of shop and when you go to it you can hit space (or whatever other button) to buy something there? :) ;) :D ;D >:( :( :o 8) ??? ::) :P :-[ :-X :-\ :-* :'(








                                  i like the smileys! :)
Old Skool!

sam

  • Fanatic
  • ***
  • Posts: 303
  • This statement is false.
    • MSN Messenger - samlancashire@hotmail.com
    • View Profile
    • samlancashire.com
    • Email
Re: Shops in a Game
« Reply #1 on: 2006-07-01, 02:58:19 PM »
have an inventory item for money, that you get when you touch a certain tile or something. have a map for the store with some graphics of items you can buy and how much they are and what button you press to buy them . Have a global function (that you have to press a button for) for each item in the store. The function should activate two other functions, a function for subtracting the money inventory and a function for adding the item inventory. If you wanted it to be even better then have another function that is also activated to paste a blank tile over the item tile in the store. :) ;) :D ;D >:(...

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Shops in a Game
« Reply #2 on: 2006-07-03, 09:01:46 AM »
I'll outline an example:
1. Create a graphic that represents a health item you can buy for $10 (10 money, whether you call it dollars or whatever).  The graphics should be drawn in the tileset that you used for the layer where the player is when he's in the store
2. Put the tile in the store somewhere
3. Create a special function called "BuyHealth" by clicking the Add button on the special functions tab of the map dialog.
4. The effect of BuyHealth should be set to alter the player's inventory to add some health (+1 perhaps).  (The activation parameters don't matter sinc ethe player will never activate this function directly)
5. Create a new tile category "BuyHealthTiles" containing the health item tile.
6. In the Tile Interaction tab on the Edit Maps dialog, create a new tile interaction for "BuyHealthTiles".  It should require 10 money, and activate the "BuyHealth" function.