Skip to content

Instantly share code, notes, and snippets.

shader_type canvas_item;
/**
Maps object texture onto a sphere and applies a spherical normal
based on a simulated light.
Adapted from
https://www.raywenderlich.com/2323-opengl-es-pixel-shaders-tutorial
and
https://gamedev.stackexchange.com/a/9385
@cbscribe
cbscribe / RigidbodyController3D.gd
Created August 27, 2017 23:47 — forked from willnationsdev/RigidbodyController3D.gd
A Basic Controller for a 3D Rigidbody in Godot 3.0
# A Rigidbody Controller for basic 3D movement
extends RigidBody
# not sure what to put here to get proper turning
var turn_speed = Vector3(1,0,0)
# not sure what to put here to get proper movement
var movement_speed = Vector3(1,0,0)
@cbscribe
cbscribe / KinematicPlatformer2d.gd
Created August 1, 2017 03:05 — forked from XANOZOID/KinematicPlatformer2d.gd
Godot easy and composable slopes platformer code (DEMO: https://media.giphy.com/media/iPQssOxSZ61Zm/giphy.gif )
# ____________LICENSE____________
# (See license.txt or the *maintained* link included for more details )
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# ______________________________
# Please credit "Abe Noll(forgotten-king)", the writer of this script and implementation.
# For what MPL-2.0 covers, I would appreciate if you went the extra mile to include a link in the source
# to any of the changes and fixes you made back to this gist, and also to leave a link on
class Explosion(pygame.sprite.Sprite):
def __init__(self, center, size):
pygame.sprite.Sprite.__init__(self)
self.size = size
self.image = explosion_anim[self.size][0]
self.rect = self.image.get_rect()
self.rect.center = center
self.frame = 0 # set frame to 0 (frame will increment based on frame rate)
self.last_update = pygame.time.get_ticks() # set last_update to gametime in miliseconds (since object initaited)
self.frame_rate = 50
@cbscribe
cbscribe / create_timer.gd
Last active February 14, 2017 19:16 — forked from brunosxs/create_timer.gd
Godot Quick Tips 01: The create_timer() helper for waiting X seconds
# Available only in the 2.2 legacy branch and posterior versions
func _ready():
# The old way:
print("HELLO") # Code before the yield
# Setting up the yield:
var t = Timer.new() # Create a new Timer node
t.set_wait_time(5.5) # Set the wait time
add_child(t) # Add it to the node tree as the direct child
@cbscribe
cbscribe / osx-for-hackers.sh
Created January 24, 2017 05:33 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx