Coding Challenge #111: Animated Sprites
In this coding challenge, I load a sprite sheet and create multiple animated sprites with the p5.js library. Code: https://thecodingtrain.com/challenges/111-animated-sprites
πΉοΈ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/vhnFx1mml
π₯ Previous video: https://youtu.be/DhFZfzOvNTU?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Next video: https://youtu.be/p4Iz0XJY-Qk?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
π Horse Sprite Sheet: https://opengameart.org/content/2d-platformer-art-assets-from-horse-of-spring
π Sprite (computer graphics): https://en.wikipedia.org/wiki/Sprite_(computer_graphics)
Videos:
π Guest Tutorial #6: The Modulo Operator with Golan Levin: https://youtu.be/r5Iy3v1co0A
π΄ Coding Train Live 147: https://youtu.be/Sz52VkVcW5o?t=9180s
Related Coding Challenges:
π #88 Snowfall: https://youtu.be/cl-mHFCGzYk
Timestamps:
0:00 Introduction
0:58 Cite resource from opengameart.org
1:45 Show sprite sheet
2:57 Show sprites' coordinates
3:15 Let's code
3:18 Draw entire sprite sheet
5:18 Draw individual sprites
7:46 Draw different sprites with the modulo operator
9:02 Create a Sprite class
10:54 Define the show function
11:45 Define the animate function
12:07 Debug Sprite class
13:00 Create a sprite object
13:31 Add multiple sprites
14:30 Animate sprites at different speed
16:25 Move sprites horizontally
16:40 Refine animation
17:45 Conclusion and creative possibilities
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
#spriteanimation #oop #p5js #javascript