Day and Night Cycle – How to Make a 2D Game in Java #46



In this video, we implement the day and night cycle. Also, we add a tent so we can sleep until the next morning.

Timestamps:
0:00 Creating day state
1:30 Switching the state of the day (Day/Dusk/Night/Dawn)
7:50 FIRST RESULT
8:52 Changing the darkness filter color
10:45 Adding a tent
13:10 Handling the Sleep state
19:05 Replacing the player image with the tent image
21:55 FINAL RESULT

#javagamedevelopment #actionRPG #tutorial

source

25 thoughts on “Day and Night Cycle – How to Make a 2D Game in Java #46”

  1. This also wasn't in my initial roadmap (my plan was to apply the darkness effect only when you are in a dungeon) but it seemed many of you guys were interested in day and night implementation so I decided to tackle on. Now I'm happy that I did it. Thank you for the suggestions guys.

    Reply
  2. I love the implementations you did in this episode! In my game sleeping is an important method of regarding your energy and the day night cycle is just an awesome thing to let a world feel more real add a different kind of environmental danger!

    Reply
  3. Dear Sir, Please can u share the code at this stage. Its my request to share the code at the end of each part so that we can compare it and rectify code if we get struck. also it will be helpful to rollback if we fail to follow you at any stage. otherwise we will not be able to make out what mistakes we did.

    Reply
  4. Hello RyiSnow, I was wondering how I could convert the code we have written so far into OpenGL. Any easy ideas so I can utilize OpenGL in my game? Also thank you so much for this video, I waited so long for this!!!

    Reply

Leave a Comment