Changes to scripts to follow GDScript style guide

Please read here for more info: https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_styleguide.html

This commit does not add/change any new/existing features.
This commit is contained in:
OverloadedOrama 2020-05-01 20:47:10 +03:00
parent 62bbad7374
commit 5a54235604
32 changed files with 295 additions and 165 deletions

View file

@ -10,6 +10,7 @@ class SimpleDrawer extends Drawer:
func reset() -> void:
pass
func set_pixel(_sprite: Image, _pos: Vector2, _new_color: Color) -> void:
_sprite.set_pixel(_pos.x, _pos.y, _new_color)
@ -19,9 +20,11 @@ class PixelPerfectDrawer extends Drawer:
const corners = [Vector2(1, 1), Vector2(-1, -1), Vector2(-1, 1), Vector2(1, -1)]
var last_pixels = [null, null]
func reset():
last_pixels = [null, null]
func set_pixel(_sprite: Image, _pos: Vector2, _new_color: Color) -> void:
last_pixels.push_back([_pos, _sprite.get_pixel(_pos.x, _pos.y)])
_sprite.set_pixel(_pos.x, _pos.y, _new_color)