solids not working

For questions about using Classic.

Post » Mon Jan 25, 2010 6:34 pm

I've changed my sprite to a physics movement, but now I need to be able to move my sprite at a specific angle.

http://dl.dropbox.com/u/2867484/brokenSkyline.cap
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Post » Mon Jan 25, 2010 9:04 pm

.cap file is blank
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Mon Jan 25, 2010 9:08 pm

[quote="Guyon":3g7vks3d].cap file is blank[/quote:3g7vks3d]

No it's not... try opening the Level1 layout ;)

Anyway, the problem is you're trying to use physics collisions, but you're not telling the player to move using physics movement. You're telling the player to move using set pixel amounts. Physics doesn't work that way.

If you are using physics, you can only tell physics objects to move using force or acceleration in the physics tab of the actions for the object. You can only tell the physics object to rotate using torque or angular velocity.

You cannot tell a physics object to "rotate n degrees" or "move n pixels." You're doing it wrong.

Basically it works like this: The Physics behavior is a simulation. It runs all the collisions in the behavior itself. It's a totally separate thing from 8Direction or Platform interacting with solid objects. Physics doesn't care if an object is checked "Solid."

Physics objects only collide with other physics objects, period.

If you want physics objects to collide then you need the physics engine to do the work for you. If you tell the sprite to "move n pixels" then it totally skips the physics engine and move the pixels like you asked. But the physics engine doesn't know you just move the sprite. It doesn't know you just intersected with a solid. Moving those pixels is not part of it's simulation. The physics engine still thinks the sprite is sleeping away perfectly still where it started off.

Anyway, long story short: Physics and regular pixel movement (including other behaviors) don't mix. Physics only works with physics.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Jan 26, 2010 4:37 am

Well then, I guess I'll redo everything :(

How do I get a physics ball to "bounce" off a wall?

And: what's the physics equivalent "move at Angle"
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Post » Tue Jan 26, 2010 5:28 am

Is there as a good Physics Tutorial anywhere?
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Tue Jan 26, 2010 5:42 am

[quote="Guyon":304dqst5]Is there as a good Physics Tutorial anywhere?[/quote:304dqst5]
already searched
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Post » Tue Jan 26, 2010 7:19 am

[quote="AfterShock":2iezzrji]How do I get a physics ball to "bounce" off a wall?[/quote:2iezzrji]

You don't have to "get" it to. It automatically does it.



[quote="AfterShock":2iezzrji]And: what's the physics equivalent "move at Angle"[/quote:2iezzrji]

"Set force towards position," or "Add force towards position," or "Set Velocity." Here's a method using Set Force:

http://dl.dropbox.com/u/529356/physics%20ball.cap

Just one event, one action, and as you can see all the collisions are done for you. That's what physics does... it just calculates speed, force, and collisions.

If you're making a game where you're manually moving a player around then you might want to look into Custom Movement instead of Physics, though. Physics is more for manipulating things indirectly, like pool balls or pinball or knocking walls down with cannonballs and stuff like that. It's not very good for direct player control in most situations because it's unpredictable... things go knocking around in all sorts of crazy ways.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Jan 26, 2010 5:30 pm

Nice Expiation and example
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Wed Jan 27, 2010 1:08 am

What version of construct did you make that on? I'm getting the "out of memory" error :(
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Post » Wed Jan 27, 2010 1:37 am

Ah, I knew I forgot something :P

It's 0.99.82
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests