The goal of this minigame was making the easiest possible game demo that has movement and collision detection for teaching purposes. Here's the source with German language commentary:

function love.load() -- hier werden zu Beginn einmalig Befehle ausgeführt
  sx,sy = 700,300 -- stehen für Spieler X- und Y-Koordinate
  cx,cy = 50,300 -- stehen für Computer X- und Y-Koordinaten
end
function love.draw() -- hier werden Bilder und Formen gezeichnet
  love.graphics.circle("fill", sx, sy, 50) -- Großen Kreis (Spieler) zeichnen
  love.graphics.circle("fill", cx, cy, 25) -- Kleinen Kreis (Computer) zeichnen
end
function love.update() -- hier werden Veränderungen berechnet
  if love.mouse.isDown("l") then -- falls Mausknopf/Touchscreen gedrückt/berührt
    if love.mouse.getY() > sy then -- wenn Maus/Finger höher als Spieler ist...
      sy = sy + 10 -- Spielerbewegung nach unten
    else -- ... in allen anderen Fällen
      sy = sy - 10 -- Spielerbewegung nach oben
    end
  end  
  cx = cx + 5 -- Bewegung des Computers nach rechts
  if cx > 800 then -- Beim Berühren des Rechten Randes
    cx = 0 -- wird der Computer nach links versetzt
    cy = math.random(1,600) -- wird die Höhe des Computers zufällig berechnet
  end 
  -- Wenn Spieler und Computer einander nahe sind
  if math.abs(sx - cx) < 50 and math.abs(sy - cy) < 50 then
    cx = 0
    cy = math.random(1,600)
  end
end

I figure some of you could use this to learn some German! :D

Needs LÖVE to run


minimal.love759 bytes
19 downloads
Stephan8 years ago

Great stuff. Shows how few lines are needed to have something interactive on the screen.

starvingindie8 years ago

I have very good memories using LOVE2d. It's been so long since I've touched the library though and my programming skills haven't improved much. This is a perfect introduction to getting quickly up and running with LOVE2d.

Have you considered turning this into a tutorial for new-comers?

Make games.

Work on some aspect of a game, let's say 5 days a week.

daily from 2015-01-25 to 2016-01-25

One Game a Week

Create any kind of game - each week

weekly from 2015-03-30 to 2016-03-28