Pixel Game Maker MV

Pixel Game Maker MV

评价数不足
Help a CAMERA Moves Smoothly!
由 erobotan 制作
This guide will provide the basic and vague logic needed to implement a smooth camera.
   
奖励
收藏
已收藏
取消收藏
Basic Logic
Wherever the Player moves, a Cameraman object will smoothly follow him/her. The game's camera will focus on this Cameraman object instead of the Player object.
The Cameraman
1. The Cameraman always accelerate and decelerate to provide a smooth moving experience. So click the object, go to the Moving and Jumping tab, and check all of the Move Type: Accelerated checkboxes.
2. When accelerating the Cameraman can not move faster than the Player. So use "Change Switch/Variable" and make the Cameraman's Horizontal & Vertical Max Movement = the Player's Horiizontal & Vertical Max Movement
3. Use "Move Object" to move the Cameraman to the center of Player. Feel free to set all of the other numbers as you see fit. You can also adjust the X & Y position too if you think the center location is no good (too low/high, or you want the Cameraman to follow behind the Player).
4. All of these 3 steps need to be executed repeatedly so copy the action box and make them loop each other.
5. Put the Cameraman on the stage and make the game's camera focus on it instead of the Player.

Additional note, in case you make the camera as the child of your player character, be sure to go to the "Parent - Child Relationship" tab, and check "Don't follow parent object"
Simple Sample
https://drive.google.com/open?id=1WM-39DrbjTHtJ3P0vPyEXsU-lwrckKvl

It's just the jumping cat demo with my camera attached. This sample make the Cameraman always follow and stay behind the Player, if you want your camera to always focus on the center of the player instead of behind him/her you probably need to delete 2 action boxes that checking the Player's Display Direction. Feel free to adjust things to suit your needs. Thanks for reading and hope this guide help you. Feedback is appreciated!
18 条留言
erobotan  [作者] 2019 年 11 月 29 日 上午 4:13 
to set the camera position you need to adjust the settings in the "Move Object" Runtime action, there are textbox for X and Y coordinate there right? if you want more sky then fill Y with negative numbers.

to soften the flip I think you need to go to Object and click the "Moving & Jumping" tab, you can adjust the Horizontal Acceleration speed there.
Keyser Söze 2019 年 11 月 29 日 上午 12:31 
I've done the tutorial a few times, kind of helps but very minimal stuff just like the help page on the site. I've made some cool enemies with the random movements and used the field of vision with some switches to make a cone flashligh thing on a robots head that switches directions when he moves and flashes and triggers it to run toward you and shoot a few bullets when you move into the light! The particles thing is fun to make your own stuff. I like the program and see a lot of potential I just wish it was a little easier to understand, and maybe not even easier to understand; Maybe just a proper manual or a big wiki or yoututbe channel. This program is like having a giant kitchen with a bunch of fresh ingredients in the pantry but not a recipe book in sight!
Keyser Söze 2019 年 11 月 29 日 上午 12:23 
Awesome works great! Thanks for the post, I really appreciate it, without people like you I'd be lost with this program lol, there is no big pdf manual or anything that explains everything- well not that I can find but I wish there was!

I'm going to play around with the setting tomorrow. Any advice on getting the camera to show more sky then ground? So the camera doesnt centre on the player and instead focuses centre about a third of the screen above the players head? That and if you have a formula to soften the flip so the direction change isn't so sudden? Anyways I'll play around and see I can can get it myself but thanks again for the original post!
erobotan  [作者] 2019 年 11 月 29 日 上午 12:18 
have you done the game's tutorial? it will really help you understand the basic.

and good luck lol! Feel free to ask question again if it doesn't work and feel free to export and use my sample in your game
Keyser Söze 2019 年 11 月 28 日 下午 11:05 
Ohhh I think I figured it out I just have to re do the conditions....hopefully lol.
Keyser Söze 2019 年 11 月 28 日 下午 11:01 
I am playing the jump sample now it's nice, just what I want, very good job. Maybe just flip the camera around slower with less of a snap. I see the bFacing variable on 0.

I thought maybe I had set up cameraman wrong so I exported the sample from your smooth jump sample. The funny thing is I can only get the cameraman to follow the cat or when I move the cat my main player follows the cat like the cameraman motion but the camera view stays static. But I can't for the life of me make the cameraman follow my player lol. I'm completely lost on the variable system to be honest. Do you mind if I keep your cameraman object in my game to use? lol if I can get it to work that is. If you are okay with letting me use your camerman object is there a way to just switch to my player and not the cat, I deleted the cat and the camerman stays still.
erobotan  [作者] 2019 年 11 月 28 日 下午 10:27 
they're pre-made variables so you don't need to create a new variables. If you click your object, there is a variables tab, check there for a list of pre-made variables

- for the details, you go click the cameraman's object, click the Action Box, add a Runtime Action "Change Switch/Variable"
- click the Runtime Action and you can see a bunch of drop box there and set Cameraman's Horizontal Max Movement = Player's Horizontal Max Movement.
- Create another "Change Switch/Variable" Runtime Action and set Cameraman's Verttcal Max Movement = Player's Vertical Max Movement
- Add "Move Object" Runtime action and set the x/y destination of the camera

have you download the simple sample? it should help you understand things easier
Keyser Söze 2019 年 11 月 28 日 下午 9:59 
Hey thanks for the post this is exactly what I need. I just got the software and I'm a little confused still, I have the cameraman set up and I have the main camera focused on it. I'm not sure how to make the camera follow my player with the variables. Do I need to ad variables in the players actions? Or just ad a variable to my player? Can you explain step 2 and 3 a little more in depth?
erobotan  [作者] 2019 年 10 月 8 日 下午 5:36 
#beoulf: ya, i think you simply need a new coordinate for the Cameraman object to follow, somewhere in the middle between the two players and keep updating it.
Studio 2019 年 10 月 8 日 下午 1:12 
@erobotan:
I should have specified, I meant multiple player objects at the same time, not switching between objects. So, having a smooth camera that follows two active player objects. (like in a co-op game or something)