What-the-freak of the day

For questions about using Classic.

Post » Sat Dec 08, 2007 7:56 pm

Well, in this .cap, when you start it, the "Bat" goes in another location that you can't see, the "Ball" doesn't move and the particles don't move. I don't really know what's happening here.

http://www.mediafire.com/?5bmmchxpx9g
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

Post » Sun Dec 09, 2007 2:55 am

WTF indeed. Something seems to always be setting the bat's Y coordinate to 648, even when you delete all the events! Congratulations on finding a really weird bug :P
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Sun Dec 09, 2007 2:02 pm

Sorry for the language but this bug it's so weird that you can only say WTF. Hope for a fix soon, or else I've got to do all again from start :(
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

Post » Sun Dec 09, 2007 3:37 pm

I found the problem, removing "8 Directions Movement" from the "Bat" don't makes the bug appear. But "Ball" and "Particle" still don't move. What's happening!?
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

Post » Sun Dec 09, 2007 11:38 pm

Messed with your game when you first posted it... I set ball and particle to Bullet movement, and could get the particles to spray downward, ball to bounce off the bat, but my lack of trigonometric ingenuity resulted in only a basic, fairly incorrect deflection when the ball hit the new wall object I made. So, I gave up on math.

http://www.mediafire.com/?62tx55scdmx
B
4
S
2
G
6
Posts: 161
Reputation: 2,597

Post » Tue Dec 11, 2007 10:55 am

I haven't looked at this game yet but if you're looking for bounce code I always use something like this:

BounceAngle = 2 * (WallAngle - ObjectAngle) + ObjectAngle

In this case, the wallangle would be the bat and the objectangle would be the ball, bounceangle would be the new angle that the ball would bounce off into.
Although I am a lazy man and I haven't looked at the game to see if this is appropriate but at least I took the effort to post this here eh? ;)
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Tue Dec 11, 2007 2:01 pm

For proper bouncing you'd need to be able to calculate the angle of the Tangent of the object at the point where it hit (this is only need for objects that arent squares.
B
2
S
2
G
5
Posts: 448
Reputation: 2,546


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest