Friday, January 24, 2020

GameMaker Studio 2 - LÖVE

3. LÖVE

LÖVE is a framework, a tool that makes programming games easier.
.....wait, what ? 😁

I was browsing through some game engines that run on linux and i found this sheepolution.com, a beautiful web contain tutorials for LÖVE game engine. Its written there, that LÖVE calls 3 functions :




- love.load()
- love.update()
- love.draw()

To draw a rectangle using LÖVE, we do the following :

function love.draw() love.graphics.rectangle("fill", 100, 200, 50, 80) end

What about GMS2 ?
Lets create a GameMaker Language Project, double click on the room0 and set it to 640 width and 480 height in room properties.











Lets create an object by pressing Alt + O.  An Object Window will appear alongside with event window.

There are lots of event listed there, but as far as i know, following LÖVE main functions, the three main event is create event, step event, and draw event.

To draw a rectangle using GMS 2, we do the following :

Add a draw --> draw event. Another window will pop up where we can write our code.
We add functions :

//Draw a rectangle
draw_rectangle(100,200,50,80,false);

Now, go to room tab, and drag the object from the right panel into room0.











Run the game by pressing F5, and voila, there's the rectangle 😊

No comments:

Post a Comment