-
Notifications
You must be signed in to change notification settings - Fork 1
Home
GXE is a simple LUA framework for making games! It has support for basic AABB overlap detection, rendering shapes, image rendering, and lots more! All you need is some basic programming knowledge and a passion for game development. A basic GXE program is very simple. It's just 3 functions. An init
function where you load any images, fonts, etc. A update
function where any game logic (player movement, collision, etc) happens. And then there is the draw
function where you draw you sprites, text, etc.
NOTE: 3 dots (...) indicates that we are continuing or editing the code block above.
On the top of the file BEFORE you create any functions or load any libraries, make a table called config
config = {
-- How wide (or fat) the window is
width = 600,
-- How tall the window is
height = 600,
-- The text you will see on top of the window
title = "Game!"
}
After you set that up, we have to define the functions:
...
function init( )
-- Setup
end
--NOTE: dt means delta time. We will go over that later!
function update( dt )
-- Update
end
function draw( )
-- Draw
end
OK! Now you should see a black window. Black windows are boring so let's give it some color!
...
function draw()
-- Good ol corn flower blue!
GXE_Graphics.ClearScreen(GXE_Color.MonogameBlue)
end
What this basically does is clear the screen with a light blue color every second. Now we are ready to draw to the screen! We will learn that next actually.