Small tutorial - Covering various topics.

Hi guys,

Here is a tutorial showing how you can alert all enemies to the player’s presence. It also shows how an object can be moved within screen limits and shows how to reset scenes.
moving_in_limits.zip (8.56 KB)

Nice!
Added on wiki.compilgames.net/doku.php/en … /tutorials :slight_smile:

Hi!

When I press up button (W) my player stops rather shortly (can’t reach even the level of the first of upper turrets) and won’t go any further. But if I press down (s) even once my player is dragged down constantly (even pressing up again slows it only for a second). So my question is: what causes this downward drag?

It feels as if the gravity is on but the game doesn’t use any behavious.

Thank you!

We can’t magically find the solution, can you show your events ?

I’m using the demo from the first post with no changes made. Just downloaded it and run to test it. Then first thing I notice is this strange downward drag. I tried to experiment with the program but can’t seem to get rid of this effect.

So just download the demo from the original post and you’ll get the events. Everything looks fine to me there.

Check the action to move the ball up (the “Add a force” action), it has a damping = 0.1, the other directions has damping = 1 :wink:

It should work well now, but the sign of the “yspeed” variable can lead to confusions, since it is positive while moving up, the GD coordinate system is an inverted Cartesian coordinate system in the y axis. It works anyway because the conditions are inverted too, and the “yspeed” works as a simple limit detector.

Thank you very much Lizard-13!

Of course, that was the matter of this damping parameter on X axis. That taught me a lot to always check the “hidden” parameters inside the code (somebody else wrote).

I know about the inverted Cartesian coords that’s why I was struggling to find an obvius solution to this drag problem.

Cheers!
Gregg