Skip to content

Instantly share code, notes, and snippets.

View nicmr's full-sized avatar

Nico nicmr

View GitHub Profile
@nicmr
nicmr / server.py
Last active June 26, 2018 09:19
tornado httpsserver
import os
import tornado.httpserver
import tornado.ioloop
import tornado.web
root = os.path.dirname(__file__)
port = 9999
application = tornado.web.Application([
(r"/(.*)", tornado.web.StaticFileHandler, {"path": root, "default_filename": "index.html"})
@nicmr
nicmr / GridBasedGodot.md
Last active July 30, 2019 01:19
Improvement to some code the youtube channel GDQuest shared on creating grid based movement in godot.

Old version for comparison:

func _fixed_process(delta):
	var is_moving = Input.is_action_pressed("move_up") or Input.is_action_pressed("move_right") or Input.is_action_pressed("move_down") or Input.is_action_pressed("move_left")
	
	direction = Vector2()
	if is_moving:
		speed = MAX_SPEED
		
		if Input.is_action_pressed("move_up"):