change image on purchase help
Hey guys, im,making a game where people can spend the coins they collect to change the image of their character. I watched t-shirt booth video on how to make a simple shop but that isnt helping. I just want them to be able to buy different color of clothes and be able to switch back and forth colors once unlocked. Thanks for the help
Comments
As far as the clothes go, you can either change the image of the actor to show different clothes or you can change the color(s) of the actor to alter the existing image.
Either way, you would have a purchase button that has a rule When touch is pressed AND game.coins > self.price, changeTableValue (tableName,self.itemRow,1) to true.
In that example, the table would have a separate row for each item. Column 1 would be a boolean representing whether the item has been purchased. Then, in the clothing actor, you would have a rule like When numeric attribute tableCellValue(tableName,self.itemRow,1) is true, change color/image to _____. You'd have to assign each purchase button a different number for self.itemRow to keep them unique.
I know that doesn't have all of the details filled in but it may give you a push in the right direction.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
how do i make it to where the user can change back to original clothes without paying coins again? I also want to make sure i understand the table. (store) is my table name. so i would do something like, "touch is pressed and game.totalcoins>10. Change game.store(1,) to true? , sorry ive never worked with tables before.
Just have a table row for the original clothes and set it to true to begin with.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Can i leave the column empty?
having such a hard time with this. been trying for the last three hours. sure its something simple im missing i just dont know what. I am even trying to do "when touch is pressed" read from the table. but im not sure what im screwing up. On the "change table value" what should i be putting in for "table, row, column, value?" if i only have one row. i followed t-shirts booth video on changing the image
but it doesnt say how to change to a specific image this way. I can just scroll up and down the table with this video.