Project Omicron

Summer 2019 project

View the Project on GitHub Mario730/omicron

1 June 2019

Project Omicron Kickoff

by

This summer I am going to be learning Phaser and JavaScript through 10 week-long series of iterations. I will be building game components and full games. At the end of the project, I will be able to demonstrate both JavaScript and game design skills and might give a talk to a local user group.

This week I mostly worked on relearning JavaScript and learning Phaser. I spent most of the week working on a plane game to hone my skills, in which the player flies around shocking goblins that try to cling to the plane. I started off by just trying to figure out how to make a background that tiles. Once I figured that out, I needed to make the background scroll based on the plane’s direction. I did figure this out, but I had to implement trig to get the background to scroll as the player turned. Originally, I had the player turning system based on the arrow keys as up, down, left, and right. But after a while, I realized that it would be better if the player could move in more than four directions. So, I changed the controls to just the left and right arrow keys so the player could rotate the plane, and would always be flying in the desired direction.

To make the shock work, I just added the shock sprite on top of the plane but made it completely transparent. Once I pressed the spacebar, it would start a tween that slowly made the electric sprite appear opaque for a tiny bit and then disappear again. However, this did not work like I wanted it to, so I used some code that essentially didn’t let the user hold down the spacebar and continually use the shock capability. I then added a boost option, where the user can hold down shift to go faster. Brock created a new sprite that was just the plane sprite with flames at the back, and then when the user pressed shift, the plane sprite was replaced with that image. In addition, when the user pressed shift, the background scrolled twice as fast, which effectively speeds up the plane.

I also created a class for all of the goblins, and a group for the goblins. I also created a group for the goblins that stick to the plane, and made sure every goblin was in one of those two groups. In the class for goblins, I added a function that essentially “kills” the goblin. So when the player uses shock and the goblins are within a radius of 200 pixels, they are removed from whatever group they are in, and then removed from the world. I have some variables that change how the game is played, like ‘goblinspeed’, which determines how quickly the goblins chase the plane.

Based off of the last week, I think that I need to take more screenshots and commit more frequently, since there is a lack of documentation throughout the creation of the plane game. Play the Plane Game Here

tags: