Why is my random movement drifting to the right?

Get help using Construct 2

Post » Fri Apr 03, 2015 11:58 pm

I have some basic mobs moving in a random fashion.

Using round(random(3)+1) also tried round(random(1,4))
for 1 self.Y-16
for 2 self.X+16
for 3 self.Y+16
for 4 self.X-16

but they tend to drift to the right and slightly downward, cloistering in a corner. Seams like the random roll is giving preference for 2 and 3. Should I do it differently like using floor instead of round? or some other way to not have it leaning.

Update: Floor made it worse I think.
B
6
S
1
G
1
Posts: 31
Reputation: 945

Post » Sat Apr 04, 2015 12:27 am

int(random(4))+1
ImageImageImage
B
71
S
21
G
204
Posts: 3,586
Reputation: 115,576

Post » Sat Apr 04, 2015 12:32 am

Thanks I'll try it


Update: looks good and seams to be working better thanks.
B
6
S
1
G
1
Posts: 31
Reputation: 945


Return to How do I....?

Who is online

Users browsing this forum: AkbarAsgharMG, lwgames, the_Shit_hawk and 3 guests