Creating a LOWREZJAM game with Godot Engine



!! this tutorial can also work with the new 3.x version Godot, but in certain places there are already bigger differences !!


The first thing I usually do on a new Godot 2.0 project is 

to adjust the project settings according to the game type.

For a perfect 64x64 pixel game that looks correct no matter what the scale,
the following settings have to be made:

Project Settings 

Display

  • turn use_2d_pixel_snap to on (no subpixel)
  • set stretch_mode to viewport (renders precisely to the resolution specified in width/height)
  • set base resolution in  width an height
  • set strech_aspect to keep ( you get black borders)

Image Loader

  • set filter to off
  • set gen_mipmaps to off

Scenes and project architecture 

When everything is set I create the main scene. It always gets the same name in my games and is always in the root of the project structure.


All other scenes are placed in the scene folder and, if necessary, in other sub directories.

Pictures, music and sound effects are stored in the resources folder.

The most important game element

Next I think about which game element is the most important

T H E  T I L E

  • it's moving
  • it should react to touch
  • it looks different in every puzzle position
  • it consists of 15 images
  • with each puzzle there are other 15 images


Some script examples

load the images an set it to the puzzle type node

var texture = load("res://ressources/images/switzerland_"+str(puzzleNr)+".png")
 get_node("tiles/type_0").set_texture(texture)

set the tile position (automatically cut image in 4x4 parts and set the right one)

get_node("tiles/type_0").set_frame(tileNr)

move tile up

func move():
 if global.canMove:
 OS.set_low_processor_usage_mode(false)
 if !rayUp.is_colliding() && position > 3:
 global.canMove = false
 tween.interpolate_property(self,"transform/pos",
                get_pos(),Vector2(get_pos().x,get_pos().y-16),
                moveSpeed,Tween.TRANS_LINEAR,Tween.EASE_OUT_IN)
 tween.start()
 get_node("effects/up/sprite/AnimationPlayer").play("on")
 yield(tween,"tween_complete")
 position -= 4
 playMoveSound()
 global.canMove = true

The rest

  • create a tile list, mix it and add the tiles in the game scene under the node.
  • check if has been won
  • load new puzzle and shuffle the tile list
  • show and hide menu
  • show and hide puzzle

If you have detailed questions you can ask them, I will try to answer them as good as possible.


Have fun!!

Get Prim d'avust

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.