top of page
Writer's pictureCade.M

Moon Lander

Updated: Sep 6, 2019

We revisited Unity after a while from the absence from the program. We went over the game engine and basic fundamentals of Unity. This lesson was following through Leigh's teachings for the Moon Lander in order to try and get it functioning. I proceeded to the project tab and played the moon lander game. I played level 1 and then accessed the remix-me file.


Now this 'remix-me' file lets you edit the level layout, coding for the player. I had implemented the files: "push with button", "rotate with arrows" scripts via the script folder. From there, I had tested out the play console at first, it wasn't going so well because in the hierachy tab, the "Player" part was under "end" meaning that the ship itself would fall all the way down till it was off screen. Furthermore, as I put the player inbetween "start" and "end" I noticed it was doing the same thing, so what i did was; I placed the ship that wasn't touching any other objects. In effect, it worked!


After that was done, I followed on through rigidbody 2D components:

Mass: 1 Linear Drag: 2 Angular Drag: 2 Gravity Scale: 0.5. Once that was done. It would implement the physics and laws of gravity automatically. After that we implemented the controls to the "player" itself. WASD are the main components for control input. W - forward, A - left, S - Back and D - right. I added another component for the player called: 'Ploygon Collider 2D' and added 2 scripts from the player were: "condition collision" and "destroy action".

Condition collision is a script that if the player meets to an object head on the collision has been met. Meaning the the player destructs itself from the object.

Destroy action is a script when the player meets head on to an object. The player gets destroyed by that object.

I had dragged the "Player" into the prefabs file to permanently save the player. What it does is that it will save all the components and traits of the created character. Think of it as: A character that is made up of code.


Once that was done I rearranged some of the rocks and asteroids to maintain a decent and challenging level design. I did this because it benefits my own game design skills which is something I want to do in the future.

Here's the level I created:


Overall was fun. I wish I had taken these screenshots sooner.

1 view0 comments

Recent Posts

See All

Comments


bottom of page