How to Make a 2D Game in Java - Random Rain Effect (Java 2D Game Demo)
5.0(0)
8 learners
What you'll learn
This course includes
26 hours of video
Certificate of completion
Access on mobile and TV
Summary
Full Transcript
This is another stuff that I tested when I was developing Blue Boy Adventure.
Here's what I did:
When you're in the field, sometimes it starts to rain for a random duration (I used a Random class and picked a duration). The mechanics are actually quite simple. I prepared four "Rain" images and when it started to rain, I put a "dark filter" so the screen became darker and switched four images at a certain interval so it would look like an animation. I also implemented a sound transition system so the field music fades away when the rain starts and is replaced with the rain sound effect.
I liked how it turned out but the game became a bit slow when it was mixed with the night/lighting effect so I decided not to use this (it worked fine during daytime though)!
Continue this lesson in the app
Install CourseHive on Android or iOS to keep learning while you move.