A downloadable resource
p5.play is a P5.js library developed originally by Paolo Pedercini that makes it easier to make games. Version 3 is led by Quinton Ashley.
This library will help you handle sprites and animation, groups of objects, collisions, and simple physics,
Getting Started Resources
With p5.play you can build on what you have been doing in p5.js
- p5.play homepage
- p5.play reference page (which can be a bit overwhelming)
"Including" the Script File in your Projects
Using the p5.js editor, create a new project that includes the p5.play library link or duplicate the project you worked on in class. Without the reference to this file, none of the p5.play functions will work.
Paste these line into the html file in the your editor:
If you get an error "Sprite is not defined" you're missing the code above.
You can also open this template sketch and click File-->Duplicate
- Create Sprites and their properties
- Images and Pixel Art for Sprite
- Basic non-player behavior
- Platform collisions
- What is a group?
- Assigning properties to: all group members or individually by their index
- Assigning collides and overlaps to Group()
- allSprites to affect every sprite in the sketch
- Get fancy with subgroups
Input (Mouse and Keyboard)
- Mouse and Keyboard basics
- Pressed = as soon as the mouse/kb button is pressed
- Pressing = holding down the button
- Holding = counts how long it's been down
- Released = when the button comes back up
|Author||Making Games at Texas Tech|