Skip to main content

2D Side Scroller : Code


- .... .- -. -.- / --. --- -.. / .. - ... / --- ...- . .-. .-.-.-

Alot of the code I used to make Ninja Frog Training I either downloaded in the case of the character controller as seen left or made myself by following a guide. As such, these pieces of code have commented in them either as they come or as part of my following of the guides. I did, however, create the Hazard code from scratch as seen below. As you can see it checks the collider if it collides with an object with the player take it reloads the scene.

I also edited the Character controller to flip the player by transforming on the Y-axis 180 rather than the method it used by default which multiplied the player's local scale by minus 1.


Comments