Artifact of the week: Stars
|
Hi there ! This week I have worked with making stars appear when enemies dies with the rest of the programmers in my group. The stars are our collectables that you get extra score from when finishing the game. The way they work is, when the enemy dies, the stars will spawn from the enemy and get velocity/speed during a brief time in a random direction. Since the time and speed are the same for all the stars, it will end up looking like a circle for the most part. When the player come near the stars, the stars will start moving towards the player. We decided that it should be like this since it is fun to collect thing but we don’t want the player to run all over the place for scattered stars. When the stars reach the player they will get deleted. Both to check if the player is near enough to move to him and if the star is close enough to the player to be collected are made by overlaps. The first overlap is checked first when the enemy dies and if the player is not close enough for the stars to start move to him they will scatter. If the enemy would be killed when the player is in range to collect the stars they will go to the player directly. Often the stars will start moving to a random position and then those that was moving towards the player will be switching over to the first overlap and chase after the player until it gets into his collect range. It looks cool when the stars gets shot out and then suddenly starts curving themselves to hit the player. There is a slight problem though, when the player is in range to make the stars go to his position right when he kills the enemy they will never go into the else if statement that tells them to scatter. Currently this makes it look like it is just one start heading towards you. We have some more important things that we have to do tomorrow so I think we will leave it like to the beta at least and see if we can delay them somehow so that it looks like you are getting ten stars instead of one. I guess we could just reduce the range for making the stars go to the player so that it wouldn’t matter when it only looked like one star because it would be so close. But then that would mean that we would have to see if that is enough range so that it does not become like chasing the stars. Now i will barage you with very precise screenshots about the behavior of the stars with paint drawings 😛 (and the update function from star)
That’s all for now, thank you for reading and have a nice day/evening/night. See you in class /Hampus Lyman |






