Array Grid Display Problem

Get help using Construct 2

Post » Wed May 15, 2013 5:54 pm

Hi,

I'm following the 2D arrary tutorial here: https://www.scirra.com/tutorials/307/arrays-for-beginners/page-3

I've named my array "grid", and is set at x=4, y=4, z=1. My sprite is named "abc1" with four different color block animations. Each animation is set to 0 speed and no loops.

Running a preview presents me with a non-symmetrical grid that cycles through random colors very quickly almost as if I have an "every tick" event set - which I do not. I was able to stop this by adding a "trigger once while true" event. Below are screen grabs of what the array looks like when previewed and the event sheet.

Event Sheet
Results

Why is my array displaying this way and why do I have to use the "trigger once while true" event in order to keep it from looping randomly through the animations non-stop?
Any help would be greatly appreciated.
B
8
S
1
Posts: 38
Reputation: 1,183

Post » Wed May 15, 2013 6:09 pm

"Every tick" is an implicit condition. Even if you don't have one, your conditions are evaluated every tick and actions are executed if the conditions are met. Just add a "on start of layout" or something above both your events. (You can also put all actions in the same event, no need to cycle your array twice.)
B
45
S
16
G
18
Posts: 845
Reputation: 13,673

Post » Wed May 15, 2013 6:12 pm

Much thanks for the info. Any ideas why the array grid is displaying the way it is?
B
8
S
1
Posts: 38
Reputation: 1,183

Post » Wed May 15, 2013 6:20 pm

Use ABC1.Width and ABC1.Height instead of Array.Width and Array.Height.
B
45
S
16
G
18
Posts: 845
Reputation: 13,673

Post » Wed May 15, 2013 6:30 pm

You, good Sir, are the man. Staring me right in the face. Isn't that usually the case?

Thanks!
B
8
S
1
Posts: 38
Reputation: 1,183

Post » Wed May 15, 2013 6:34 pm

Yeah, and we oftentimes need someone else to point out the obvious !

No problem, glad to help !
B
45
S
16
G
18
Posts: 845
Reputation: 13,673


Return to How do I....?

Who is online

Users browsing this forum: Artpunk and 18 guests