Skip to content

Instantly share code, notes, and snippets.

View Razzlegames's full-sized avatar

Kyle Luce Razzlegames

View GitHub Profile
@Razzlegames
Razzlegames / SCsub.py
Last active August 29, 2015 14:16
Some changes to play around with for Godot Android build templates
import shutil
import os
Import('env')
android_files = [
'os_android.cpp',
'godot_android.cpp',
'file_access_android.cpp',
func newSanta():
var santa = res.instance()
santa_count += 1
var name = "santa"+str(santa_count)
santa.set_name(name)
add_child(santa)
list_of_stuff.push_back(name)
print("Object owner is: "+ str(santa.get_owner()) + \
"This node's owner is: "+ str(get_owner()))
santa.set_owner(self)
extends Node2D
var rock_points = 0
var rock_res = preload("res://rock.scn")
var time_passed = 0
# Used only to create a unique rock name
var rock_count = 0
func _ready():
var lookup_table = {}
#*****************************************************************
func getDictParam(param):
return lookup_table[param]
#*****************************************************************
func _ready():
lookup_table["pond"] = "Frog"
lookup_table["grass"] = "Dog"
var test = null
#*****************************************************************
func _ready():
# This works fine
if(test != null):
# Free resources etc
# ...
print("not null")
#*****************************************************************
# In this game, there's a valid node called "Chair"
# - This will print "node isn't null" therefore verifying our
# assumptions that queue_free will not null the reference
# - You can even use the reference before this function is
# done executing (but don't do this in a real game)
func _ready():
var node = get_node("Chair")
if(node != null):
# This will not null our reference.
/** Matrix values for orientation */
static final int ACCELEROMETER_AXIS_SWAP[][] = {
{1, -1, 0, 1}, // ROTATION_0
{-1, -1, 1, 0}, // ROTATION_90
{-1, 1, 0, 1}, // ROTATION_180
{1, 1, 1, 0}}; // ROTATION_270
//*****************************************************************************
@Override
# The ship is from: <div xmlns:cc="http://creativecommons.org/ns#" about="http://millionthvector.blogspot.com/p/free-sprites.html"><a rel="cc:attributionURL" property="cc:attributionName" href="http://millionthvector.blogspot.com/p/free-sprites.html">MillionthVector</a> / <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a></div>
# The Background is from: http://www.jpl.nasa.gov/spaceimages/details.php?id=PIA16883
extends Node2D
export var ship_speed = 100
export var acceleration = 10
var current_speed = Vector2(0,0)
#version 110
//----------------------------------------------
// Environment Vertex Shader
//----------------------------------------------
varying vec3 ReflectDir;
varying float LightIntensity;
uniform vec3 LightPos;
// Eye position in world cordinates
uniform vec3 eye_pos;
E/WindowState( 561): getStack: Window{1cf21765 u0 kanankh.nutcopter.atlantra/com.gamesalad.player.GSGameWrapperActivity} couldn't find taskId=1198 Callers=com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedInner:9603 com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedLoop:8662 com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLocked:8604 com.android.server.wm.WindowManagerService.executeAppTransition:4107
E/WindowState( 561): getStack: Window{1cf21765 u0 kanankh.nutcopter.atlantra/com.gamesalad.player.GSGameWrapperActivity} couldn't find taskId=1198 Callers=com.android.server.wm.WindowState.getDisplayContent:762 com.android.server.wm.WindowStateAnimator.updateSurfaceWindowCrop:1255 com.android.server.wm.WindowStateAnimator.setSurfaceBoundariesLocked:1430 com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedInner:9691
E/WindowState( 561): getStack: Window{1cf21765 u0 kanankh.nutcopter.atlantra/com.gamesala