Star Field



Image result for space low poly


A new assignment has been set, ready for new challenges and learn new things. For this assignment I will be completing the “Star field” tutorial which the main goal of this tutorial is to crate projectiles which will be used as a background animation for the mini arcade game. Afterwards, when the tutorial has been completed, I will proceed to add some new features, animations and make things more interesting. 





For this tutorial, this time I made use of the “on game update” instead of “on start”. I only had to create one project in able for me to set the snowy effect background. At first I thought, “how am I going to run all those dots if I only made one projectile”. But then I started to figure out how to make that happen and things started to make since.

Basically what I did, was that the projectile is made every time the game updates so there will appear a bunch of dots going downward since I only have my velocity in a range of 20 and 30in the y-axis.Then, I set the projectile to generate at a random position throughout the width of the screen which will be only on the x-axis. Finally the percentage is to accommodate the amount of projectiles that are generated on each game updated, so, if it is 5%, there will be less projectiles generated than if it were in 75%.




Now that tutorial has been completed, it’s time to use some of my own creativity and add more things to my code. I firstly focused on creating another projectile with a similar function to the other projectile. The main difference was that, for my first projectile, I set it as “ghost” which means that this projectile will be seen but it will not interact with other things within the screen. My second projectile on the other hand, could interact with sprites or projectiles within the screen except the ghost projectile.

Some other small differences were that, the aspect or image is different, (it has an asteroid shape) the velocity is set to 20, and the percentage is only 1%, so there will be less asteroids generated.




It still seemed kind of simple, so I decided to add a sprite into the mini arcade game. I set a little cat as the image for my sprite and set the sprite of a kind player. I can control the cat with the arrow keys or the a, s, d, w keys. If the cat overlaps the asteroid projectiles, it will be destroyed and a life out of three will be taken out init the cat has no lives left. I wanted to make use of the function to get used to using it more and understanding how it works. I created a function named “cat” under this function I told the program what to do when this function is used. This function can only work if I call the function “cat”, as you can see in the following image, on start game, I called the “cat” function and as soon it is called, the program will run the function.





To Conclude

To finish up with my project, I’ll give my personal opinion and my experience during my task. I think I made progress, learned new things, a few but it’s something. I also used some of my knowledge from the previous tasks. I didn’t do too much details and more animations because I am also working in another bigger project where I have to create a game and it takes time to prepare and elaborate. I think I did a good job.

Comments