top of page
Search

power up (Coconut rain)

  • Writer: Jade Taylor
    Jade Taylor
  • Jun 23, 2022
  • 2 min read

when first thinking about how to make the coconut rain, we wanted something that would disrupt the player's vision, sort of like Mario Cart when the ink goes on the player's screen impairing their vision for a moment.

So we thought we could do something similar but instead make it rain coconuts on the player, this will happen when the player collects the random power-up on the barrier and then they click the assigned button, it will then rain coconuts on their opponent.


However this won't cause any additional damage.





It starts off at the power pick-up event, and also the random generator once it has selected the coconut rain it will then run this code.



This code shares the same as the slow down powerup also but when the coconut rain is selected it runs off the bottom code.


This is getting the chosen player ID and then displaying the coconut rain HUD.







version 1

the first way I thought about doing this would be by actually having coconuts fall on top of the player.

when stood still it would look and be very effective, however, as the players won't be standing still when this happens and instead be running around even possibly jumping, all the coconut would've spawned at the coordinates the player was at when the power-up was activated. To make this work it would've meant to code it so it would predict where the player would move too, which with my knowledge and skill level would be virtually impossible with the given time.



Version 2





So what I thought would work better instead, would be to make it an animation. I did this in blender, by importing the FBX of the coconut and then making it a particle system, and setting the number of coconuts I wanted to drop within the 120 frames. I also put it in front of a green screen to make it easier to edit within the engine.


after rendering this, I imported it into the engine, and made a media player, and a widget for the HUD. and connected it up to the rest of the code, so when the powerup has been triggered this will apply the animation to play.





 
 
 

Comentários


bottom of page