-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added MainMenu/PauseMenu/NewLevel/Rain/GunOverHeat #8
base: master
Are you sure you want to change the base?
Conversation
Gun.cs - added overheat system Pauser.cs - disabled and use my own script for PauseMenu Remover.cs - go back to MainMenu when the player die
Please add them to build setting for everything to work smoothly
Please add scenes to build setting for everything to go smoothly. Also rain effect might be off because it doesn't automatically locate RainMat so if you can please do so under Rain/Partical System/Renderer(inspector)/Material
@@ -45,7 +45,7 @@ void FixedUpdate () | |||
} | |||
|
|||
// Set the enemy's velocity to moveSpeed in the x direction. | |||
rigidbody2D.velocity = new Vector2(transform.localScale.x * moveSpeed, rigidbody2D.velocity.y); | |||
GetComponent<Rigidbody2D>().velocity = new Vector2(transform.localScale.x * moveSpeed, GetComponent<Rigidbody2D>().velocity.y); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this PR I spotted the use of GetComponent inside update and fixed update loops. How do you think this could be made more efficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of calling GetComponent() every time it loop, have a reference variable so you only need to call GetComponent() once and use that reference variable to update the velocity.
Please add scenes to build setting for everything to go smoothly. Also rain effect might be off because it doesn't automatically locate RainMat so if you can please do so under Rain/Partical System/Renderer(inspector)/Material.
Added:
MyImages folder - images I used to create the new level/gameplay
MyScripts folder - store all the scripts I made for the main menu and pause menu
MainMixer - to adjust the volume of the game
RainMat - for rain effect
New Scenes - including MainMenu, Level 1, and Level 2
Changed:
Gun.cs - added overheat system
Remover.cs - changed so that it will return to main menu when player die
Pauser.cs - disabled to use my own pause scripts