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
| -- Demonstration of love physics with a kinematic body | |
| -- based on dynamic version: https://love2d.org/wiki/Tutorial:Physics | |
| -- | |
| -- | |
| -- When an object is controlled by setting its position instead of applying | |
| -- forces, it should be kinematic. But when it interacts with dynamic | |
| -- bodies, sometimes they are sleeping and do not respond to collisions. | |
| -- | |
| -- Possible solutions: | |
| -- * set velocity instead of position |
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
| // TERMS OF USE - EASING EQUATIONS | |
| // | |
| // Open source under the BSD License. | |
| // | |
| // Copyright © 2001 Robert Penner | |
| // All rights reserved. | |
| // | |
| // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |
| // | |
| // Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
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
| -- Test file for chained function calls for lua syntax | |
| -- Source: https://love2d.org/forums/viewtopic.php?t=77904 | |
| local flux = require "flux" | |
| local colon_out = self.kitchen | |
| :getContents() | |
| :getCheese() | |
| :enjoyCheese(self | |
| :mouth() |
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
| // public domain | |
| // Add to Scripts/Editor/PrefabDetector.cs | |
| using System.Collections.Generic; | |
| using System.Collections; | |
| using System.Linq; | |
| using System; | |
| using UnityEditor.Experimental.SceneManagement; | |
| using UnityEditor.SceneManagement; | |
| using UnityEditor; | |
| using UnityEngine; |
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
| // Released under CC0 and Unlicense | |
| // Demo: https://imgur.com/a/9h3c6W5 | |
| // Screenshake should move the camera around smoothly but unpredictably. It | |
| // shouldn't jitter the camera around in a way that makes it hard to follow | |
| // what's on screen. That's why you should use continuous oscillating functions | |
| // to produce your shake instead of random values. I also think it's useful to | |
| // make a directional shake to help connect the shaking to the thing that | |
| // caused it. |
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
| " An extremely rough approximation of vscode's inliner: | |
| " https://www.youtube.com/watch?v=EenznqbW5w8 | |
| " Uses vim's popupwin to show the definition of a tag. Hijacks the arrow keys | |
| " to let you move a cursor inside that window and jump to another tag. | |
| " | |
| " Public domain, CC0. | |
| let g:tagpopper_z = 0 | |
| " Turning this off hides some bugs but then preview window is even more | |
| " superior. Not sure why sometimes popup contents is clobbered. |
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
| -- public domain, CC0 | |
| -- extremely basic class. | |
| -- only supports instances and constructors (no inheritance, mixin, etc). | |
| -- Copypaste this function to your module to avoid depending on a class library. | |
| local function Class() | |
| local cls = {} | |
| cls.__index = cls | |
| setmetatable(cls, { | |
| __call = function(cls_, ...) |
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
| -- Public domain/CC0 | |
| -- A pid controller (proportional–integral–derivative controller). | |
| -- Useful to track an entity without overshooting (like a docking spaceship). | |
| -- Could be expanded to control orientation, speed, or other values. | |
| -- Requires tuning values: | |
| -- tuning = { | |
| -- gain = { | |
| -- -- all in [0,1] |
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
| #! /usr/bin/env python3 | |
| """ | |
| Video editing tools. | |
| I don't remember the args for ffmpeg and it's useful to run them on multiple | |
| videos in sequence. Great for shrinking game video that was captured at 4k. | |
| Assumes ffmpeg is in your path. On Win10, use scoop to install (https://scoop.sh/). | |
| Use .cmd files like this to make a drag-and-drop target: |
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 KinematicBody | |
| class_name KinematicCar | |
| # Based on MIT-licensed car tutorial from KidsCanCode | |
| # https://kidscancode.org/godot_recipes/3.x/2d/car_steering/ | |
| # https://github.com/kidscancode/godot_recipes/blob/master/src-3/content/2D/car_steering.md | |
| # Ported some features from https://kidscancode.org/godot_recipes/3.x/3d/kinematic_car/car_base/ | |
| export(float, -100, 0, 1) var gravity := -20.0 | |
| export(float, 0.001, 180, 1) var max_steering_angle := 15 |