Planetary Gravity Platformer

S

Secondary_Primary

Guest
Question! I'm trying to figure out how to make a platformer with gravity towards planet like objects. I've found examples to help (such as this mario example, its NOT MINE, all credit to this awesome guy who made it http://gmc.yoyogames.com/index.php?showtopic=351438)

I would like, however, to create an example of something along these lines, but where the camera instantly rotates with the player sprite, so it always looks like the player sprite is facing up. In this example I've shown, there is a delay, and the only other two examples don't rotate the camera. Trying to increase the camera rotation speed in the create or step actions of the Player object cause, on large scale planets, a lot of glitching about. Any suggestions on what to do? Hope I explained my problem well. Thanks!
 

johnwo

Member
rotates with the player sprite
To rotate the camera/view without delay, simply do something like this:
Code:
var offset = 90; // 90 degree offset, can be used for shaking and stuff; But if it isn't needed, just set it to 0, or remove entirely
view_angle[0..7] = obj_player.image_angle+offset
I havne't used view_angle in a while so I don't remember clearly, but you might have to do something like view_angle[0..7] = 360-obj_player.image_angle; but I am not sure about this at all.

Hope that helps!

Cheers!
 

Yal

šŸ§ *penguin noises*
GMC Elder
To clarify, use the number between 0 and 7 that corresponds to the view you're actually using. And actually, if you only use view 0, you can leave out the [0...7] part completely for all view variables - Mike has confirmed this is intentional functionality.
 
Top