Just added some game objects that control the player’s gravity along the X-axis. These objects are the calabashes. The gravity vector can only be changed in direction. So once the player hits the calabash, the direction of the vector changes to the opposite direction. Since the player can only be moved in the opposite direction of gravity, this increases the difficulty level for the user, but also allows for use on a mobile device where the user just taps the screen and the player moves accordingly.
More islands have been added to the switch case used to instantiate obstacles. Calabashes and coconuts have been separated from the island switch case in order to change the rate at which calabashes and coconuts are instantiated along the game route. It’s evident that a path finder algorithm needs to be added so that the player does not come across a fully blocked path along the game route. Some sort of position detection also needs to be implemented so that the islands, coconuts and calabashes do not overlap throughout the game field. Overall, I am happy with my progress so far. The big island is the only island I am missing in the obstacles.
Check out the video below. It’s important to note that I am only moving the player in one direction. At the beginning of the game, a gravity vector is initiated. As the player hits the calabashes, it changes the direction of the “current” and thus you can only move the player in the opposite direction of the gravity vector. Still lots more to do!