On this brief video collection course, we’ll discover ways to write a platformer (or side-scrolling) recreation like Tremendous Mario. We are going to write this recreation from scratch with very fundamental algebra with out counting on any physics engine!
Beneath are the entire sources together with video lectures, code, and labs. I created this curriculum for my AP Laptop Science A course in the course of the present faculty closures as a result of coronavirus. Subscribe to my channel.
For those who educate AP Laptop Science A and would really like options, be happy to contact me straight.
1) Recreation Preview
A preview of the platformer recreation that we’ll write.
2) Introduction to Processing
A fast introduction to Processing, a software program sketchbook that enables us to simply create animations/video games with easy Java code.
- Bouncing Ball Lab (Pleasant Model, Extra Difficult Model)
Given a ball PNG picture, simulate a ball bouncing on the display.
3) Creating the Sprite Class
Making our recreation object-oriented by creating the Sprite class, which is the superclass of all of our recreation objects.
- Sprite Class Lab (Pleasant Model, Extra Difficult Model)
Implement the Sprite class. That is the bottom class for all recreation objects.
4) Controlling a Sprite Utilizing the Keyboard
Controlling our participant utilizing the keyboard.
- Controlling A Sprite Utilizing Keyboard Lab (Pleasant Model, Extra Difficult Model)
Management a sprite with the keyboard.
5) Creating the Recreation Map by Utilizing a CSV File
Create a recreation map or stage stage utilizing a comma-separated values (CSV) file.
- Design CSV Recreation/Stage Map Lab
No coding lab. Learn code and modify CSV file to create a stage map.
6) Collision Detection
Detecting collision between sprites. We’ll implement the checkCollision technique which returns true if two sprites collide and the checkCollisionList technique which returns the collision listing between a sprite and a listing of sprites.
- Gather Cash Lab (Pleasant Model, Extra Difficult Model)
Tank strikes round on the display and acquire cash. Coin counter is show and up to date on the display.
7) Resolving Platform Collisions Half 1
Understanding the maths behind resolving platform collisions. That is an important algorithm in scripting this recreation.
8) Resolving Platform Collisions Half 2
Implement the code to resolve platform collisions.
- Resolving Platform Collisions Lab
Add gravity and resolve platform collisions. That is an important algorithm within the recreation.
9) Add Leaping
Add in leaping means to the participant.
- Leaping Lab
Add leaping function to our recreation. You’ll want your answer from the earlier Resolving Platform Collisions Lab.
Add scrolling to the sport.
- Platformer Scrolling Lab
Implement scrolling for the platformer recreation.
- (Non-compulsory) Scrolling Lab (Pleasant Model, Extra Difficult Model)
Implement scrolling. Draw left/proper/high/backside boundaries to visualise scrolling.
11) Animating the Sprite(makes use of inheritance)
Create AnimatedSprite class for easy animated Sprites. AnimatedSprite inherits from the Sprite class.
- Animated Sprites Lab (Pleasant Model, Extra Difficult Model)
Animate the cash from the earlier Gather Cash lab.
12) Creating Enemies(makes use of inheritance)
Creating animated enemies by inheriting from the AnimatedSprite class.
- Create Enemies Lab (Pleasant Model, Extra Difficult Model)
Create an ArrayList of Enemy objects utilizing CSV file. Every enemy has a unique stroll size between its left and proper boundaries.
13) Animating the Participant(makes use of inheritance)
Create Participant class which inherits from the AnimatedSprite class to animate the participant.
- Animating the Participant Lab (Pleasant Model, Extra Difficult Model)
Animate a easy model of the participant to stroll left and proper. No leaping or platform collisions.
14) End Up Recreation
End up the sport by including recreation over display and restart function.