Game not selecting appropriate Sprite

Bugs will be moved here once resolved.

Post » Mon Jun 25, 2012 7:00 pm

When a player touches an object it's suppose to use that object as the "holder" for any events regarding that sprite, no? So if I had this;

Player>On Collision With>Sprite2

then this would work for Sprite2, no?

Sprite2>Set Position>(0,0)

BUT!! My problem is that when I touch "Sprite2" it indexs the position of Sprite2 that's on the bottom of Z-Order, cause in my game, I have 2 Sprite2's and the game calls for the one of the bottom of Z-order. Isn't it suppose to call for the one my Player touched?
B
10
S
3
G
3
Posts: 45
Reputation: 2,984

Post » Mon Jun 25, 2012 7:06 pm

I can provide a .capx if you need one.
B
10
S
3
G
3
Posts: 45
Reputation: 2,984

Post » Mon Jun 25, 2012 7:25 pm

Yeah, provide the .capx. It's positioning the touched sprite2 for me.

Is this how your event is setup?

+player: on collision with sprite2
--- sprite2: set position to (0,0)
B
79
S
24
G
54
Posts: 4,753
Reputation: 40,769

Post » Mon Jun 25, 2012 9:03 pm

Yes, but what happens is that the second object named "Sprite2" that happens to be on Bottom layer for Z-Order is moved. Also, I was using the positioning as an example, the real thing involve Angular Gravity and stuff. But here; http://dl.dropbox.com/u/86157339/Construct2/Examples/Game.capx
B
10
S
3
G
3
Posts: 45
Reputation: 2,984

Post » Mon Jun 25, 2012 9:07 pm

Basically, the code takes the touched sprite that my character touches, then takes the angle of Player and it, and then rotates the player to that, along with setting the Angular Gravity to that rotation, while rotation the map. The only problem is, is that it alway's takes the Angles in the [angle(Player.X,Player.Y,GravityZone.X,GravityZone.Y)] that is on the Bottom layer for Z-Order. Help?
B
10
S
3
G
3
Posts: 45
Reputation: 2,984

Post » Mon Jun 25, 2012 10:08 pm

When the player is on the right side it's overlapping both GravityZones due to the collision polygon. To fix it edit the animations for GravityZone and crop frame 1.
B
79
S
24
G
54
Posts: 4,753
Reputation: 40,769

Post » Mon Jun 25, 2012 10:21 pm

Thank you so much!
B
10
S
3
G
3
Posts: 45
Reputation: 2,984


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests