Aetherial2D Project – Character Movement

When you try to programme a game, the first thing you are going to think about it is your main character. The most basic thing for the character which you are going to programme is movement. Movement seems like the thing easiest to programme but the most important part of a character, also it is the core of your character.

When I was doing this,  I needed to add two things to the character to be able to move him around. First of all, I needed to add 2D rigid body which communicates with the physics in Unity.  Besides this, I also needed to add a script to it.  For the movement, I declared a variable movement speed, a public variable which can change it anytime inside Unity inspector.微信截图_20180304224838.png Then I used both the vertical and horizontal velocity speed to multiply with it, so that we can control the speed and change it anytime.

 

 

 

 

 

 

 

I have written some code for flipping the character, we can do it by changing the scale x value to negative.


The reason why I did this is we actually had an open world in the game at first. I have made the camera follow the player all the time, and set the background picture really huge. The enemies will come from both sides of the screen. That’s why I needed make the character can flip in the game. But after some days, I realized this might not be a good idea. It would be smaller for the player to see the scene in the game. I think it’s better to do it sooner rather than later. And what we should do now is learn as many skills as possible to prepare for the next arcade project. Although I didn’t use the camera follow this time, it doesn’t mean that I wasted my time to do it. I think the main thing we should learn from Game Design 2: Game Development is how to work with the team to complete and deliver a project. Lay a solid foundation for the next class or future work as much as possible.

About Kaijun Wang

2017 Programming