hi there,
for the game I'm making I need a shop system, so I did the ingame shop tutorial and got a basic structure.
In my game, there is a sprite called 's_sword', this consists of multiple frames, each frame is another sword.
The variables I have so far are:
total_money; your total amount of gold.
current_weapon: the weapon you currently have equipped.
current_weapon=1, means s_sword frame 1.
I got a system working for buying now..
But this is where I get stuck. I have a another sprite called s_sword_icon, that gets placed in the shop.
each frame of the s_sword_icon should be linked to the frames in s_sword. as example: s_sword_icon frame 1 = s_sword frame 1.
when the player presses a certain keyboard key and is overlapping frame 4 of s_sword_icon, the current_weapon should be 4.
when this happens the s_sword_icon should change into another sprite called s_sword_icon_bought, meaning you purchased the sword and now can choose to equip this one or another one.
I hope it is somewhat clear what I want to achieve, and I'll post updates when I figure stuff out.
And if anyone has a better and more efficient way of doing this, I would be glad to know
I also read a lot about Arrays, but those seem look difficult.