[r197] Created object is outside layout instead of inside

Bugs will be moved here once resolved.

Post » Mon Feb 23, 2015 8:59 pm

Problem Description
I try to create object inside layout with random position using
75+Random(LayoutWidth-150)
75+Random(Layoutheight-150)
but generated number is inside layout, object is generated outside, for example, width is 1700, generated X is 1200, and object is drawn outside.
What is interesting, with older version I don't have that problem, also it looks like when loading old capx, with similar code, unchanged, doesn't reproduce same behaviour in 197

Attach a Capx
--> in attachment

Description of Capx
Single layout game, there is player (baloon), obstacles, and gems
on the start it should generate 5 objects on random positions. I have kept simple game mechanics, disable death on obstacel, but kept death on border, changed window size to match layout size for easier visual demonstration. I tried to translate everything relevant to problem for easier understanding.
On the side note, Layer Rename, doesn't rename references in EventSheet

Steps to Reproduce Bug
  • Just start layout and 5 gems should appear within layout on random positions
  • On game over (baloon fell down) it should generate new set of objects, 2-3 tries should be enough to reproduce

Observed Result
Depending on random function, less then 5 objects appear

Expected Result
All objects should appear within layout

Operating System and Service Pack
win 7 sp1

Construct 2 Version ID
197b
You do not have the required permissions to view the files attached to this post.
B
57
S
9
Posts: 19
Reputation: 3,932

Post » Mon Feb 23, 2015 9:09 pm

Sorry, my error, looks like I've changed Image Point to something far away.
I panicked, I have simple demostration of C2 in few hours.
B
57
S
9
Posts: 19
Reputation: 3,932

Post » Tue Feb 24, 2015 11:48 am

Closing as not a bug
Scirra Founder
B
367
S
217
G
82
Posts: 23,262
Reputation: 183,679


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest