Skip to content

Instantly share code, notes, and snippets.

View rodydavis's full-sized avatar
:electron:
Creative Coding

Rody Davis rodydavis

:electron:
Creative Coding
View GitHub Profile

Create a vite web app. Create an isometric 2.5D game that has controls for rotating, panning (up, down, left, right, and angles) and zooming.

The game should be a simple tile builder (like legos) using Three.js. It should allow a user to build walls, water/rivers, trees, and dirt/grass.

The goal of the game is tower defense and should have a start and end part of the map where one side the user protects and the other is where the enemies come out of.

The game should show a game over state when the health is depleted and towers for defense can also have health bars and ways to upgrade.

When enemies are killed then the user collects gold for upgrades and resources.

@rodydavis
rodydavis / rfw-core.md
Last active May 5, 2025 17:50
RFW LLMs.txt

Core Widgets for Remote Flutter Widgets (RFW)

This document outlines the core widgets available for use with Remote Flutter Widgets (RFW), detailing their supported properties.

Important Considerations:

  • Enums are represented as strings (e.g., "start" for MainAxisAlignment.start).
  • Types with multiple subclasses (e.g., ColorFilter) are represented as maps with a type key.
  • Matrices are represented as column-major flattened arrays.
  • AlignmentGeometry can be {x: ..., y: ...} or {start: ..., y: ...}.
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:signals/signals_flutter.dart';
import 'package:signals_hooks/signals_hooks.dart';
import 'package:sqlite3/common.dart';
import 'package:sqlite3/sqlite3.dart';
const _memoryPath = ':memory:';
CommonDatabase useDatabase({
String path = _memoryPath,
String? vfs,
@rodydavis
rodydavis / actions.dart
Created March 26, 2025 21:07
Flutter common actions: prompt, confirm, alert, toast, navigate
import 'package:flutter/material.dart';
Future<String?> prompt(BuildContext context, {String? value, String title = 'Edit Text'}) async {
final controller = TextEditingController(text: value);
final theme = Theme.of(context);
final colors = theme.colorScheme;
final saved = await showDialog<bool>(
context: context,
builder:
(context) => AlertDialog(
@rodydavis
rodydavis / crdt.c
Last active March 17, 2025 01:04
CRDTs in SQLite with just custom extensions
#include <sqlite3ext.h>
SQLITE_EXTENSION_INIT1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
// Helper function to execute a SQL statement
static int execute_sql(sqlite3 *db, const char *sql) {
import 'dart:ffi';
import 'dart:typed_data';
import 'package:sqlite3/sqlite3.dart';
import 'package:sqlite3/src/ffi/implementation.dart';
import 'package:uuid/uuid.dart';
import 'hlc.dart';
void main() {
@rodydavis
rodydavis / main.dart
Last active March 17, 2025 15:14
SQLite CRDT + Session Extension
import 'dart:ffi';
import 'dart:io';
import 'dart:typed_data';
import 'package:sqlite3/sqlite3.dart';
import 'package:sqlite3/src/ffi/implementation.dart';
void main() {
final lib = DynamicLibrary.open('cr-sqlite/core/dist/sqlite3');
final sqlite3 = FfiSqlite3(lib);
@rodydavis
rodydavis / my-element.js
Last active March 5, 2025 15:29
HTML Web Component with support for SSR
// @ts-check
import { WebComponent } from "./utils.js";
const tagName = "my-element";
const template = /*html*/ `
<span>
Hello, <span id="name">World</span>!
</span>
import 'package:jaspr/jaspr.dart';
import 'package:signals/signals_core.dart';
import 'watch.dart';
import 'embedded_counter.dart';
class Counter extends StatefulComponent {
const Counter({super.key});
@override
import 'dart:js_interop';
import 'dart:js_interop_unsafe';
import 'package:web/web.dart';
class WebComponent<T extends HTMLElement> {
late T element;
String get extendsType => 'HTMLElement';
void connectedCallback() {}