Skip to content

Instantly share code, notes, and snippets.

View edubart's full-sized avatar

Eduardo Bart edubart

View GitHub Profile

Create an addictive game.

I'll help you create an addictive game for the RIV console. First, let me create a game design document that fits RIV's constraints while aiming for addictive gameplay mechanics.

Game Design Document: Color Match

Game Overview

Title: Color Match Genre: Fast-paced Puzzle/Action Core Concept: A hypnotic and addictive color matching game where players must quickly match their color with incoming circles to score points. The game creates "just one more try" addiction through quick sessions and escalating difficulty.

@edubart
edubart / riv_prompt.txt
Last active February 3, 2025 17:57
RIV developer prompt
You are an expert C game developer in creating games for the RIV game console.
Your goal is to develop games for the RIV game console using its C API.
You are also very capable of creating game design documents.
# RIV
RIV has the following C API and documentation:
/file riv.h
@edubart
edubart / machine-c-api.rs
Created September 25, 2024 15:46
Machine C API rust bindings
/* automatically generated by rust-bindgen 0.70.1 */
pub const CM_MARCHID: u32 = 18;
pub const CM_VERSION_MAJOR: u32 = 0;
pub const CM_VERSION_MINOR: u32 = 18;
pub const CM_VERSION_PATCH: u32 = 1;
pub const CM_VERSION_LABEL: &[u8; 1] = b"\0";
pub const CM_MIMPID: u32 = 18;
pub const CM_HASH_SIZE: cm_constant = 32;
pub const CM_TREE_LOG2_WORD_SIZE: cm_constant = 5;
pub const CM_TREE_LOG2_PAGE_SIZE: cm_constant = 12;
@edubart
edubart / main.nelua
Last active December 26, 2021 12:25
WASM4 Nelua template
require "wasm4"
local smiley: []uint8 = {
0b11000011,
0b10000001,
0b00100100,
0b00100100,
0b00000000,
0b00100100,
0b10011001,
@edubart
edubart / gfxtoy.nelua
Last active December 17, 2021 23:04
gfxtoy test
-- THIS whole framework is hacky and just a PROOF OF CONCEPT!
##[[
primtypes.number = primtypes.float32
primtypes.integer = primtypes.int32
primtypes.uinteger = primtypes.uint32
if OPENMP then
cflags '-fopenmp'
end
local function parallel_for()
@edubart
edubart / nene_microui.lua
Created September 22, 2021 01:13
Micro ui nene
require 'microui'
require 'hashmap'
require 'nene.core'
require 'nene.colors'
require 'nene.math'
require 'nene.font'
require 'nene.text_texture'
local mu: mu_Context
local nene: Nene
@edubart
edubart / nelua-opencv-example.cpp
Last active August 7, 2021 18:33
Example using OpenCV with Nelua
/* Generated by Nelua 0.2.0-dev */
/* Compile command: g++ -x c++ "/home/bart/projects/nelua/nelua-lang/nelua_cache/play/draft.c" -o "/home/bart/projects/nelua/nelua-lang/nelua_cache/play/draft" -fwrapv -g -Wall -Wextra -I/usr/include/opencv4 -DWITH_OPENEXR=OFF -lopencv_core -lopencv_imgcodecs -lopencv_highgui -lm */
/* Compile hash: 2oc8quwtnUC8s47mULrq1Bsh5u2U */
/* ------------------------------ DIRECTIVES -------------------------------- */
/* Disable some warnings that the generated code can trigger. */
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtype-limits"
#pragma clang diagnostic ignored "-Wwrite-strings"
#pragma clang diagnostic ignored "-Wunused"
#pragma clang diagnostic ignored "-Wunused-parameter"
@edubart
edubart / blueplanet.c
Last active July 27, 2021 22:05
Blue Planet in C
/* Generated by Nelua 0.2.0-dev */
/* Compile command: c2m "/home/bart/projects/nelua/nelua-lang/nelua_cache/demos/planet.c" -o "/home/bart/projects/nelua/nelua-lang/nelua_cache/demos/planet" -w -lSDL2 */
/* Compile hash: 2oufrcKZe8TBnJwdhtW2c9mqSzEe */
/* ------------------------------ DIRECTIVES -------------------------------- */
#include <math.h>
#include <stdint.h>
#define SDL_MAIN_HANDLED
#define SDL_DISABLE_MMINTRIN_H
#define SDL_DISABLE_IMMINTRIN_H
#define SDL_DISABLE_XMMINTRIN_H
@edubart
edubart / pcall.lua
Last active July 13, 2021 13:41
Experimental pcall implementation for Nelua
##[[
local typedefs = require 'nelua.typedefs'
typedefs.function_annots.noerror = true
local cgenerator = require 'nelua.cgenerator'
local CEmitter = require 'nelua.cemitter'
local orig_Call = cgenerator.visitors.Call
function cgenerator.visitors.Call(context, node, emitter, ...)
local isblockcall = context:get_visiting_node(1).tag == 'Block'
local funcscope = context.scope:get_up_scope_of_kind('is_function')
local funcsym = funcscope and funcscope.funcsym
##[[
if GLSL then
primtypes.number = primtypes.float32
primtypes.integer = primtypes.cint
primtypes.uinteger = primtypes.cuint
else
primtypes.number = primtypes.float32
primtypes.integer = primtypes.int32
primtypes.uinteger = primtypes.uint32
end