inventory type thing

For questions about using Classic.

Post » Sat May 09, 2009 10:40 am


This is basically my menu thingo, each cell is a value.
When my variable equals the same as the cell value, the cell is selected (shows as '2' in the picture).

This is what I'm doing for moving down the menu ( in the first column):

[code:2x13z7np]
-Down is pressed |
-Value >= 1 | Add 1 to value
-Value <= 4 |
-Value = 5 | Set value to 1

[/code:2x13z7np]

And a similar thing for moving up, except subtracting 1 from value.

This works fine, however I'm having trouble moving left/right

I've tried something like this (for moving right in the first row of the menu):

[code:2x13z7np]
-Right is pressed |
-Value = 1 | Add 4 to value
- OR |
-Value = 5 |
- OR |
-Value = 9 |
-Value = 13 | Set value to 1
[/code:2x13z7np]

However it doesn't always seem to work right. Is there a different/better way to code something like this?

.
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Sat May 09, 2009 1:37 pm

Wouldn't it be easier if you used two values, one for the x position and one for the y? That's how arrays work, which look a lot like what you're making.
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Sat May 09, 2009 1:39 pm

Could you post the .cap file? Makes it alot quicker to ascertain exactly what's going on.

Thanks.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sat May 09, 2009 2:35 pm

I might try that idea Arima. The reason they are only a single value at the moment, is cause I'm working with the unique ID of the object, since all the cells are the same object.

@Rich, I'm not sure if I should, its got hundreds of events and they're filled with a lot of crap.
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Sat May 09, 2009 4:35 pm

YOu could make a 2d array and set values for each 'cells' in the array depending on the values on oyur menu..

Then when navigating the menus you use the x-y method and then just get the unique id form the object which is found at x,y(where your pointer is at)
B
16
S
10
G
5
Posts: 255
Reputation: 3,934


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests