Snake Game - Adding Colors | Part 6

Опубликовано: 30 Июль 2026
на канале: Applied Coding
178
1

In this episode, we add colors to the snake, obstacles and environment. Also we perform some code refactoring to move logic to the class it belongs to.

Blog: https://blog.appliedcoding.club/2021/...
Source code: https://github.com/AppliedCodingClub/...

0:00 Intro
0:13 Dynamic Screen Size
1:43 Let's Colorize
2:25 Snake Color
3:16 Red Obstacles
4:04 Green Food
4:41 Blue Background
6:13 Code Refactor
9:45 Refactor paintBackground()
10:58 Refactor paint()
12:14 Refactor paintRemove()
12:45 Refactor snake.paint()
13:08 Refactor obstacle paint()
13:33 Refactor food paint()
13:47 Refactor main constructor
15:20 Refactor createObstacles()
15:55 Wrap Up

#Java #LearnToCode #CodingForBeginners #LiveCoding

👨‍💻 About me

🖥 I am a software developer with more than 20 years of experience in the tech industry. I love to teach, debug problems and optimize my code for perfection.

📽 In my channel, you find videos describing how to solve coding problems, develop games, prep for job interviews and overall talk tech. I chose the name AppliedCoding, because I will teach you exactly that - applied coding - I show you how to analyze real problems, break them down into manageable chunks, come up with an algorithm, choose the right data structures, talk about the pros and cons… and only then code the solution.

*****
👉 Blog: https://blog.appliedcoding.club
👉 Instagram:   / appliedcoding  
👉 Facebook:   / appliedcodingclub  
👉 Github: https://github.com/AppliedCodingClub