getting-started


"init" = initiate (start)

function _init()

end

In game development, "init" refers to a function that initializes or sets up the game's initial state, variables, and resources before the game starts running. This can include loading assets such as graphics and sound files, setting up the game world and player, initializing game mechanics and rules, and performing any necessary calculations or configurations. The init function is typically called at the beginning of the game or when a new game session starts, and is important for ensuring that the game runs smoothly and as intended.



2300

24 Apr 2023


function _update()

end

In game development, "update" refers to a function that updates the game state and renders the game world on each frame of the game loop. The update function can include code that updates the position and behavior of game objects, handles user input, performs game logic, and calculates physics and collision detection. The update function is called once per frame (30 times per second) and is critical for ensuring that the game runs smoothly and responds correctly to player inputs and in-game interactions. 

To increase the framerate of the game, use _update60 instead.

function _update60()

end


1816

15 Mar 2023


function _draw()

end

In game development, "draw" refers to a function that renders the game world and its objects onto the screen. The draw function can include code that displays graphics, animations, text, map, and other visual elements that make up the game's user interface. The draw function is called after the update function has updated the game state on each frame, and is important for displaying the updated state to the player. By rendering the game world on each frame, the draw function ensures that the player sees a smooth and responsive display of the game, enhancing the player's experience.

The draw function will match the update function's framerate. So if you use _update60() then _draw() will also run 60 times per second.

1934

15 Mar 2023


Images in this Guide by NerdyTeachers is licensed under CC BY-SA 4.0
Font