| command | description |
|---|---|
| FREEZERENDERING | This commands freezes the culling state and lets you fly around to see what is actually being rendered. |
| stat initviews | stats relevant to culling. |
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
| //! This is some code I wrote after watching the GMTK (Game Makers Toolkit) video | |
| //! on how the presenter implemented 'Passive Modifiers' in a word-making game. | |
| //! See: https://www.youtube.com/watch?v=n1cd1FhVAWY | |
| //! | |
| //! In that video he showcases an implementation that uses class inheritance and | |
| //! virtual functions. I thought that's a great concrete example of gameplay code | |
| //! that can be used to show how I think about programming, where I would go the route | |
| //! of tagged unions and switch statements. | |
| //! | |
| //! To be clear, this isn't a 'my way is better' piece. What's presented in GMTK is |
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
| // Registration omitted for brevity | |
| const TestNode = struct { | |
| base: *godot.class.RefCounted, | |
| pub fn create(allocator: *Allocator) !*TestNode { | |
| var self = try allocator.create(TestNode); | |
| self.* = .{ | |
| .base = godot.class.RefCounted.init(), | |
| }; |
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 example of Multi-Core by Default | |
| //! See https://www.rfleury.com/p/multi-core-by-default | |
| //! This solves part 1 & 2 of Advent of Code 2024 day 1: https://adventofcode.com/2024/day/1 | |
| //! Code by Luke Perkin (2025) | |
| const std = @import("std"); | |
| const Allocator = std.mem.Allocator; | |
| const Thread = std.Thread; | |
| threadlocal var thread_ctx: *ThreadContext = undefined; |
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
| const std = @import("std"); | |
| const LineParser = @import("LineParser.zig"); | |
| const fs = @import("fs.zig"); | |
| const raylib = @import("raylib.zig"); | |
| const c = raylib.c; | |
| const Map = struct { | |
| cells: CellArray, | |
| symbol_indices: IndicesArray, | |
| numbers: NumbersArray, |
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
| const std = @import("std"); | |
| const c = @cImport({ | |
| @cInclude("raylib.h"); | |
| }); | |
| const word_numbers = [_][]const u8{ | |
| "one", | |
| "two", | |
| "three", | |
| "four", |
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
| //! ============== | |
| //! Anytype Antics. | |
| //! ============== | |
| const std = @import("std"); | |
| const debug = std.debug; | |
| const builtin = std.builtin; | |
| const trait = std.meta.trait; | |
| fn print(string: []const u8) void { debug.print("{s}\n", .{string}); } | |
| const DONT_COMPILE = false; |
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
| //! ====== | |
| //! file: mario_state_machine.zig | |
| //! This is an example of a Mario/Powerup state machine. | |
| //! It showcases the usefulness of switches and tagged unions in Zig. | |
| //! See state machine diagram: | |
| //! https://external-preview.redd.it/TgwKB-bdEWJase06sIDXmVtaGaP7AZTD9YKn0x4yUWo.png?auto=webp&s=c0318b178038bd83212392c8fdd16e1a4b1a0049 | |
| //! ====== | |
| /// This is a tagged union. | |
| /// See tagged union doc: |
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
| using UnityEngine; | |
| using System.Linq; | |
| using System; | |
| using System.Reflection; | |
| public class BindComponent : PropertyAttribute | |
| { | |
| public enum FindMode | |
| { | |
| InSelf, // Find the component on the calling GameObject. |
NewerOlder