So I wanted to challenge myself this afternoon since it’s a Friday and all. So i said I was going to make a “complete” game in one hour.
While I was driving to WholeFoods I had an idea for a game where meteors would randomly spawn above my head in a first person style and I would have to avoid them.
At 4:18 I started and it’s 5:14 and I’m typing this up.
The game is pretty bad, but it’s playable and has a death scenario including falling off the edge.I put in some sound effects from this glorious package and I used some FX for the explosion from my favorite FX package
The end result is something playable albeit I almost felt neck strain while playing and I’m not even doing the looking, my player is.
I basically created two meshes in Blender. One was a scaled up cube to be the floor and another was an icosphere to be the meteor.
I used the standard FPS controller and created a script that used OnCollisionEnter to detect death scenarios. In those cases, I did SceneManager.LoadScene(“dead”) which had a script that after 2 seconds just loaded the game scene again. It also had some fancy UI text that said DEAD
I had a collision check on the meteor that detected the ground and started a particle system when that happened and set a timeout of 2 seconds before using Destroy to remove it. I also attached an Audio Source to the meteor prefab with some unrealistic sound effect so you could sorta hear where they were spawning.
To control spawning, I created a plane above the ground at the height I wanted them to fall from and then setup a Coroutine which would spawn a new meteor prefab randomly between 2 and 10 seconds. It would use the bounds of the sky plane to randomly pick a location where to spawn from.