Bubble Gun!
BlogPost #2WhatThis week I have been working on the bubble gun that is a very important asset in our game. This bubble gun is represented as a pick-up that is spawn when an enemy dies. It is able to shoot poisoned bubbles to damage the enemies and follow the rotation of the mouse around the screen. Furthermore, it can shoot with a “cone” pattern in order to give more visual reality. I actually started working on this bubble gun a week before. The goal was to have a working weapon with the basic mechanics in order to be tested for play testing. After the play testing, as a group, we realized that this bubble gun didn’t look as was supposed to because the bubbles generated had all the same speed and size. Therefore was necessary to implement more features for example a different size for the bubble and more effects. So that is what I have been working on this week.
HowThe logic and functionality of the bubble gun is managed by a script that I created by myself. In the script I implemented some public variables that could be changed in the Inspector of the prefab in Unity. In the variables is possible to change the range for the minimum and maximum speed as well as size of the generated bubbles. These values are then defined randomly within the ranges in the script. The directions of the bubbles are defined by three different “directional points” as reported in the image #1. The wideness of the cone is determined by a variable that is changeable in the Inspector. The “directional points” and the “spawn point” are basically game objects that are child of the bubble gun in order to keep them related to the bubble gun when it rotates. In order to give a more realistic effect to the bubbles, their speed is slowed down by a variable called “Linear Drag” that is available in the RigidBody2D component. Furthermore, since our game need to give a feeling of falling to the player, I added some gravity force to the bubbles so that they have a curvy effect and flow towards the top the screen. ![]()
WhyThe reason for creating this weapon is to give the player a weapon that is not the classic one with single bullet. The experience while shooting with this bubble gun is satisfying, this because of the random speed and size and gravity effect of the bubbles that are generated.
|
