Movement (Week 7)
The player is controlled by the Eight Way Movement script - with additions added to include sprinting in short bursts (set to 0.5 seconds currently). There is a trail renderer on the player to give a sense of motion, the colours and visual style of this will be refined.
Next step was to add a mark to the player sprite so that the player has an indication as to which way they are facing. I simply added a small black rectangle to the player sprite.
I then added a new script so that the player would rotate to face the mouse, which would not affect their movement direction. I found a really handy 'bite-sized' tutorial to achieve this at: www.youtube.com/embed/Geb_PnF1wOk
var dir = Input.mousePosition - Camera.main.WorldToScreenPoint(transform.position); var angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg; transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward);
(Indie Nuggets, 2018)
Now we have fast and fluid movement, with independent aiming towards the mouse.
Next steps:
- Introduce the laser mechanics. I have started to implement the ray casting - I just need to connect the ray tracing (with 1 bounce/reflection) into a line renderer that reads the hit points and draws the laser
- Test out some health mechanics, refining how long it takes for the player to die / get hurt after being hit by the laser
- Introduce smallest 'grub' enemies, the fast paced but easy to kill variant. This will include spawner behaviour and basic AI to hunt the player (seeking style)
References
Indie Nuggets, 2018. Unity Nuggets: How to "Look At" Mouse in 2D Game. [video]
Please Don't Touch the Laser
Battle waves of enemies with your laser stuck on, just try not to hit yourself.
Status | Released |
Author | Brodie Farrell-Oates |
Genre | Shooter |
Tags | Endless, Top down shooter, Twin Stick Shooter |
Languages | English |
Accessibility | High-contrast |
More posts
- Documentation + User GuideMay 30, 2021
- Week 12May 22, 2021
- Week 11May 16, 2021
- Week 10May 09, 2021
- Week 9May 02, 2021
- Week 8Apr 25, 2021
- Concept Log (Assignment)Apr 15, 2021
Leave a comment
Log in with itch.io to leave a comment.