The idea behind G Rapidement Envie de Coder (GREC - I Wanna Code Quickly) is to take the concept of a game jam / hackathon and apply it a short project so third year computer science students can use it to learn a new concept or language. The project should be able to be completed in a weekend or 48 hours.
LÖVE makes it very easy to display sprites and images to screen. As such my first step was to draw the different blocks needed for the different tetrominos. I started off by drawing each tetrimino with Aseprite:
After thinking about it a bit more, I realized drawing each different color block separately would be easier to deal with in-game and maybe a little more memory-efficient in the long run, although that is not the priority.
Loading and displaying an image in Lua with LÖVE looks like this:
-- Load the image to a variable
sprite = love.graphics.newImage("path/to/image")
-- Draw `sprite` to screen at (150, 150)
love.graphics.draw(sprite, 150, 150)
That’s it for now, the next article will likely be about how the game board works. I hope you enjoyed reading this, see you next time!