building a menu

For questions about using Classic.

Post » Tue Sep 06, 2011 12:43 pm

What would be an elegant/efficient way to do the following:

In game, in a menu:
Items can get upgraded.
Click on the item to upgrade it.
After clicked on the item, and it is upgraded, it is visually shown by a circle-sprite behind it.

Example:
<sword> X X X (not upgraded)
<sword> O X X (upgraded once)
<sword> O O X (upgraded twice)


I was thinking about the following solution, but it is cumbersome, I think:

+With every creation of the upgrade-menu:
-> place X-sprites on the correct positions.
-> give every X-sprite its own number, so that you know which number is which X-sprite.

+ Sword: Is global variable 'SwordUpgrade' Equal to 1
+ X-sprite: identify the first X-sprite (number 1)
-> UpgradeStar: Set animation frame to Circle-sprite-frame.rogerty2011-09-06 12:46:26
B
16
S
5
G
7
Posts: 599
Reputation: 5,000

Post » Wed Sep 07, 2011 11:40 pm

I got this working, but I was just wondering if this was something common, where experienced (construct-)programmers had some advice for.
This is not urgent.
B
16
S
5
G
7
Posts: 599
Reputation: 5,000


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests