Coding Challenge #111: Animated Sprites

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



Duration: 19:58
116,931 views
3,050


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







Tags:
daniel shiffman
creative coding
coding challenge
tutorial
coding
challenges
coding train
the coding train
live stream
class
challenge
codingtrain
code challenge
javascript (programming language)
programming challenge
p5.js tutorial
sprite
sprite sheet
sprite sheet animation
sprite animation javascript
animated sprites
animated sprite tutorial
animated sprite js
computer animation
p5.js animation
animated sprite
video game
spritesheet