Coding Challenge #72: Frogger Refactoring

Subscribers:
1,750,000
Published on ● Video Link: https://www.youtube.com/watch?v=c6WdJltqEtM



Game:
Frogger (1981)
Duration: 37:20
39,455 views
674


In this multi-part challenge, I create a simplified version of the classic Atari video game Frogger in Processing (Java). Code: https://thecodingtrain.com/challenges/72-frogger

๐Ÿ’ป Github Repo: https://github.com/CodingTrain/Frogger

p5.js Web Editor Sketches:
๐Ÿ•น๏ธ Frogger: https://editor.p5js.org/codingtrain/sketches/crMMFw8vD
๐Ÿ•น๏ธ Frogger - Refactored: https://editor.p5js.org/codingtrain/sketches/C8gqXQ3Qd

Other Parts of this Challenge:
๐Ÿ“บ Part 1: https://youtu.be/giXV6xErw0Y
๐Ÿ“บ Part 2: https://youtu.be/06-ZvYmSeus
๐Ÿ“บ Part 3: https://youtu.be/hk326ZHlENQ

๐ŸŽฅ Previous video: https://youtu.be/LFU5ZlrR21E?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ŸŽฅ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH

References:
๐ŸŒ Frogger on Wikipedia: https://en.wikipedia.org/wiki/Frogger

Videos:
๐ŸŽฅ Video of the Gameplay: https://youtu.be/l9eTOaNFwKQ
๐ŸŽฅ Overloading: https://youtu.be/V7k5bFQbhG0
๐ŸŽฅ Video Games track: https://thecodingtrain.com/tracks/games
๐Ÿ”ด Coding Train Live 97: https://youtu.be/m9EsKBPCggk?t=4350s

Related Coding Challenges:
๐Ÿš‚ #3 The Snake Game: https://youtu.be/AaGK-fj-BAM
๐Ÿš‚ #46 Asteroids: https://youtu.be/hacZU523FyM
๐Ÿš‚ #67 Pong!: https://youtu.be/IIrC5Qcb2G4
๐Ÿš‚ #71 Minesweeper: https://youtu.be/LFU5ZlrR21E
๐Ÿš‚ #91 Snakes & Ladders: https://youtu.be/JrRO3OnWs5s
๐Ÿš‚ #115 Snake Game Redux: https://youtu.be/OMoVcohRgZA

Timestamps:
0:00 Today's objective: refactor the code
3:15 Create a Lane class
4:15 Rename logs and cars as Obstacles
6:56 Make an array of lanes
22:35 Use constructor overloading to add color to the lane
24:30 Add game play back
26:03 Use type to indicate whether an obstacle is a car or log
28:43 Use type to refactor the check function
31:44 Detach the frog when it moves
32:32 Use the lane index to register which lane the frog is in
35:23 Conclusion and ways to contribute

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

๐Ÿš‚ Website: http://thecodingtrain.com/
๐Ÿ‘พ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
๐Ÿšฉ Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
๐Ÿ’ก GitHub: https://github.com/CodingTrain
๐Ÿ’ฌ Discord: https://thecodingtrain.com/discord
๐Ÿ’– Membership: http://youtube.com/thecodingtrain/join
๐Ÿ›’ Store: https://standard.tv/codingtrain
๐Ÿ–‹๏ธ Twitter: https://twitter.com/thecodingtrain
๐Ÿ“ธ Instagram: https://www.instagram.com/the.coding.train/

๐ŸŽฅ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ŸŽฅ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

๐Ÿ”— p5.js: https://p5js.org
๐Ÿ”— p5.js Web Editor: https://editor.p5js.org/
๐Ÿ”— Processing: https://processing.org

๐Ÿ“„ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new

#gamemechanics #froggeratari #inheritance #processing







Tags:
live
programming
daniel shiffman
creative coding
coding challenge
tutorial
coding
challenges
coding train
the coding train
live stream
itp
itp nyu
frogger
frogger processing
frogger coding challenge
simple frogger
frogger Java
Processing Java frogger
game frogger
code
processing
processing tutorial
programming challenge
game mechanics
simple game
frogger atari
frogger atari processing
code refactor
object overloading
constructor overloading



Other Statistics

Frogger Statistics For The Coding Train

At present, The Coding Train has 203,726 views spread across 4 videos for Frogger, and about an hours worth of Frogger videos were uploaded to his channel. This is less than 0.17% of the total video content that The Coding Train has uploaded to YouTube.