How do I calculate this

Get help using Construct 2

Post » Sun Apr 09, 2017 8:28 am

i have global variable value
column =10
another is
row = 5
now how can i calculate
10x1
10x2
10x3
10x4
10x5
without using array
if possible
Image
B
64
S
39
G
46
Posts: 656
Reputation: 32,728

Post » Sun Apr 09, 2017 9:03 am

Use loops. But I'm lost here, how are you gonna calculate if you don't have an array? Where are the values being stored?
Image Image Image
B
31
S
11
G
27
Posts: 748
Reputation: 17,093

Post » Sun Apr 09, 2017 9:14 am

i have a sprite of 50 frames
i want to positioned them with events, not manually
10 width
5 height of grid
so i am trying to do this
Image
B
64
S
39
G
46
Posts: 656
Reputation: 32,728

Post » Sun Apr 09, 2017 9:22 am

I see.
Then it's just a simple matter of choosing your grid size and setting position:

For example a 32x32 grid.
Set Sprite to 32*Width, 32*Height
Taking into consideration where in your layout the grid starts, you should add these values to the Upper Left Corner of the grid.

Now whether the words 'Width' and 'Height' are usable for global/instance vars is a whole other story.
You could also try out Rex's grid plugins but I have no experience using those.
Image Image Image
B
31
S
11
G
27
Posts: 748
Reputation: 17,093

Post » Sun Apr 09, 2017 9:39 am

thanks
but i get an idea
without using array and plugin
i have done it
Image
B
64
S
39
G
46
Posts: 656
Reputation: 32,728


Return to How do I....?

Who is online

Users browsing this forum: ST314 and 24 guests