Download the distribution code for your game from https://cdn.cs50.net/games/2019/x/assignments/0/assignment0.zip and unzip assignment0.zip
, which should yield a directory called assignment0
.
Then, in a terminal window (located in /Applications/Utilities
on Mac or by typing
cmd
in the Windows task bar), move to the directory where you extracted assignment0
(recall that the cd
command can change your current directory), and run
cd assignment0
Your first assignment in the course will be a fairly easy one, since the dive into game programming can be deep enough as it is without having to implement an entire code base from scratch! Instead, we’ll take the Pong example we covered in class and extend it in a small but fun way by giving one of the paddles (or perhaps both) logic for playing the game so that you don’t always need a buddy to play the game with you! We’ll approach problem sets in the course this way generally, taking the full code bases we’ve used in lecture and extending them so that you’ll get plenty of experience interacting with fully implemented games. You can even use these projects as templates and jumping boards for your own games!
Of course, the code won’t run if you don’t have LÖVE2D installed, so we’ll have to tackle that in addition to grabbing the code; the course uses version 0.10.2 for its source code, so do just choose the appropriate distribution of that version for your system here:
https://bitbucket.org/rude/love/downloads/
For further information on how to actually run games, do just visit the following page:
https://love2d.org/wiki/Getting_Started
Once the code and LÖVE2D have been downloaded and installed, the actual change you’ll be making to the code base is
small, but it will require you to understand what many of the pieces do, so be sure to watch Lecture 0 and read
through the code so you have a firm understanding of how it works before diving in! In particular, take note of how
paddle movement works, reading both the Paddle
class as well as the code in main.lua
that actually drives the
movement, located in the update
function (currently done using keyboard input for each). If our agent’s goal is
just to deflect the ball back toward the player, what needs to drive its movement?
Your goal:
As of 1 August 2020, you are viewing an old version of this specification. Be sure to visit the newest version at https://cs50.harvard.edu/games/2018/assignments/0/ for the latest submission instructions.