'F' → Fullscreen
Copy template-game to 1-13-control. Give it x, y, size and speed at the top, draw a square, and add four questions:
function love.update(dt) if love.keyboard.isDown("right") then x = x + speed * dt end
if love.keyboard.isDown("left") then x = x - speed * dt end
if love.keyboard.isDown("up") then y = y - speed * dt end
if love.keyboard.isDown("down") then y = y + speed * dt endendRun it and move around. Hold two keys at once and write down what happens — nothing in the code says diagonal.
Remember that up subtracts from y. That is session 2's coordinate system, and it will feel wrong for about thirty seconds.
Right now the square leaves and does not come back. This is not a bounce — you do not want it to turn around, you want it to stop:
if x < 0 then x = 0end
if x > 800 - size then x = 800 - sizeendAdd the same two for y, using 600. Run it and push into every wall.
if, completely different behavior.Add a variable local big = false at the top, and make the square draw at size or size * 2 depending on it.
love.keypressed. It came with the template and it is what Escape uses. Add the space branch to the one that is there — do not write a second copy. Two functions with the same name is not an error in Lua; the second one silently replaces the first, and Escape stops working.function love.keypressed(key) if key == "space" then big = not big end
if key == "escape" then love.event.quit() endendPress space. Hold space. It toggles once, no matter how long you hold it, because the engine only calls this at the moment the key goes down.
big = not big is last session's not doing something useful: whatever it was, make it the other one.
Copy the template again to 1-13-mouse. Draw a ring wherever the mouse is:
function love.draw() local mx, my = love.mouse.getPosition()
love.graphics.setColor(0.3, 0.7, 1) love.graphics.circle("line", mx, my, 26)
love.graphics.print("Mouse at " .. mx .. ", " .. my, 40, 40)endThen drop a marker where you click:
function love.mousepressed(mx, my, button) markerX = mx markerY = myendAdd markerX and markerY at the top, start them off screen at -100, and draw a filled circle there.

Starting the marker at -100 is a small trick worth knowing: it exists, it is drawn every frame, and nobody can see it until you move it.
Go back to 1-13-control and move one of the four movement questions into love.keypressed instead:
function love.keypressed(key) if key == "right" then x = x + 10 endendHold the right arrow down. Compare it with holding the left arrow, which still uses isDown. Write down exactly what the difference feels like, and which one you would want for a game.
No error. Both versions are correct Lua and both do what they say.
Make the square from 1-13-control chase the mouse instead of using the keyboard — each frame, move it a little toward wherever the pointer is.
Two decisions across, two down. If the square is left of the mouse, move right; if it is right of it, move left. Watch what happens when it arrives.
1-13-control moves in four directions and cannot leave the window1-13-mouse tracks the pointer and drops a marker where you clickAnswer the following questions before submitting your work.
love.keypressed, and it ran anyway. Name two other things in your program that work the same way, and say what they all have in common.Submit the required files to the appropriate dropbox.