This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var acc_samples = [] | |
| var average_acc = Vector3() | |
| const SAMPLES = 10 | |
| var current_sample_i = 0 | |
| func _ready(): | |
| # Initialize samples to zero | |
| for i in range(SAMPLES): | |
| acc_samples.push_back(Vector3(0,0,0)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func screenToWorldMath(screen_coord, camera_pos, screen_size, zoom): | |
| # This is how the engine does it | |
| var local_matrix = (get_canvas_transform() * get_global_transform()).affine_inverse() | |
| var inv_coord = local_matrix * screen_coord | |
| inv_coord = Vector2(floor(inv_coord.x), floor(inv_coord.y)) | |
| print("inv_coord: "+ str(inv_coord)) | |
| var new_pos = screen_coord | |
| if(zoom.x != 0 && zoom.y != 0): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| W/SurfaceFlinger( 282): Fail to Open /sys/devices/platform/gpusysfs/fps | |
| I/DEBUG ( 301): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** | |
| I/DEBUG ( 301): Build fingerprint: 'samsung/jfltespr/jfltespr:5.0.1/LRX22C/L720VPUGOK3:user/release-keys' | |
| I/DEBUG ( 301): Revision: '11' | |
| I/DEBUG ( 301): ABI: 'arm' | |
| I/DEBUG ( 301): pid: 22017, tid: 22036, name: GLThread 2301 >>> com.razzlegames.supersantaa <<< | |
| I/DEBUG ( 301): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1c | |
| I/DEBUG ( 301): r0 a308e374 r1 9d00b4ac r2 b4b02480 r3 00000000 | |
| I/DEBUG ( 301): r4 a308e374 r5 00000001 r6 00000001 r7 b396ff00 | |
| I/DEBUG ( 301): r8 b6fd6e04 r9 9e3fc500 sl b396ffe4 fp 9d08a6c0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func someTest(t, a): | |
| pass | |
| func setRunningAnimation(): | |
| someTest("this thing", \ | |
| "some other thing") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Serialization type pulled from: | |
| // http://docs.godotengine.org/en/stable/reference/binary_serialization_api.html | |
| const int FLOAT = 3; | |
| typedef struct GodotFloat | |
| { | |
| // Type for float in serialization | |
| int type; | |
| float value; | |
| }GodotFloat; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Defined in upper scope | |
| int last_x = 0; | |
| // pick a last_x initial value less than any you're checking for | |
| // This only prints something if x changes. | |
| // Since it is assumed x is monotonically increasing | |
| // will print only once per condition | |
| if(last_x != x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extends Area2D | |
| var items_touching = {} | |
| # Just an example of how to itereate over all items in a dictionary. | |
| # If you need a specific item, always look it up by the key for fast performance | |
| func iterationExample(): | |
| for item in items_touching: | |
| print("items_touching: "+str(item)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| uniform float depth1 = 4.0; | |
| uniform float focus = .5; | |
| float aspectratio = 1920.0/1080.0; | |
| vec2 aspectcorrect = vec2(1.0,aspectratio); | |
| float bias = 0.6; | |
| float blurclamp = .01; | |
| //float factor = ( depth1- focus ); | |
| float factor = .08; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extends Node | |
| # All in a Singleton instance | |
| signal general_collection_event | |
| var GENERAL_COLLECTION_EVENT_NAME = "general_collection_event" | |
| func _ready(): | |
| pass | |
| # other gd scripts whom care about receiving ,of course there shoulda collectionEvent(total) func defined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extends Node2D | |
| var path_direction = 1 | |
| var curve = null | |
| export var curve_speed = 80 | |
| # Path to follow | |
| export(NodePath) var curve_path = null | |
| func _ready(): | |
| if(curve_path != null): |