This file contains 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
// move | |
lastPosition = position; | |
position += velocity * Monocle::deltaTime; | |
CollisionData col; | |
if(Collide("Solid", &col)) | |
{ | |
// move to last position | |
// 64 is the radius of the player collider | |
position.y = col.hitPoint.y + (col.normal.y * 64); |
This file contains 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
// render light circles | |
for (i = 0; i < lights.length; i ++) | |
{ | |
l = lights[i]; | |
var isSet:Object = new Object(); | |
for (j = 0; j < l.distance * 2; j++) | |
{ | |
isSet[j] = new Object(); |
This file contains 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
using UnityEngine; | |
using System.Collections; | |
using UnityEditor; | |
[CustomEditor(typeof(TerrainManager))] | |
public class TerrainEditor : Editor | |
{ | |
private TerrainManager terrain { get { return (TerrainManager)target; } } | |
private Vector2Int? selected; |
This file contains 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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
[RequireComponent(typeof(MeshFilter))] | |
[RequireComponent(typeof(MeshRenderer))] | |
[RequireComponent(typeof(MeshCollider))] | |
[ExecuteInEditMode] | |
public class Tile3D : MonoBehaviour |
This file contains 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
let data = { | |
title: "All My Posts", | |
posts: [ | |
{ title: "first post", body: "nothing to see here" }, | |
{ title: "second post", author: { name: "Somebody" }, body: "another post, wow" }, | |
{ title: "final post", body: "this is the end" } | |
] | |
}; | |
let fs = require("fs"); |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.IO.Compression; | |
using System.Text; | |
// File Format: | |
// https://github.com/aseprite/aseprite/blob/master/docs/ase-file-specs.md | |
// Note: I didn't test with with Indexed or Grayscale colors |
This file contains 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
-- This creates proper GUIDs for Aseprite files so the game can load them. | |
-- To Use: | |
-- 1) Open Aseprite and go to File -> Scripts -> Open Scripts Folder and place this file there | |
-- 2) Restart Aseprite | |
-- 3) Run this script when you save an Aseprite file and it will automatically create | |
-- GUIDs for the sprite along with every slice | |
-- More Info: https://www.aseprite.org/docs/scripting/ |
This file contains 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
#pragma once | |
namespace YourNamespace | |
{ | |
struct Routine | |
{ | |
// Current "waiting time" before we run the next block | |
float wait_for = 0; | |
// Used during `rt_for`, which repeats the given block for X time |
This file contains 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
#include <blah.h> | |
#include "imgui/imgui.h" | |
#define IMGUI_DEFINE_MATH_OPERATORS | |
#include "imgui/imgui_internal.h" | |
using namespace Blah; | |
namespace | |
{ | |
MeshRef mesh; |
This file contains 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
using System.Diagnostics; | |
using System.Numerics; | |
using Foster.Framework; | |
using ImGuiNET; | |
public static class Gui | |
{ | |
private static readonly VertexFormat VertexFormat; | |
private static IntPtr context; | |
private static bool beginCalled = false; |
OlderNewer