Skip to content

Instantly share code, notes, and snippets.

View luizbills's full-sized avatar
I may be slow to respond.

Luiz Bills luizbills

I may be slow to respond.
View GitHub Profile
@luizbills
luizbills / code.js
Last active February 14, 2025 13:50
Simple scene manager for Litecanvas games
/**
* @version 1.1.1
*/
class SceneManager {
constructor(engine = globalThis) {
this.list = {}
const events = [
'update',
'draw',
'tap',
@luizbills
luizbills / code.js
Last active January 23, 2025 18:59
Simple tilemap engine #litecanvas
/**
* @version 0.1.2
*/
function tilemap(map, { tileWidth = 32, tileHeight = 32, tiles, engine = globalThis }) {
let cols = 1,
rows = map.length,
result = {},
tilegrid
for(const line of map) {
@luizbills
luizbills / code.js
Last active July 12, 2025 15:31
Simple particles example #litecanvas
let particles = [],
colors = [3,5,7,9]
litecanvas({
width: 256,
pixelart: true,
})
function explosion(x, y, size = 64, color = 3) {
const max = 16
@luizbills
luizbills / docker-compose.yml
Last active December 10, 2024 12:15 — forked from bsurrey/coolify.memos.docker-compose.yml
Memos Coolify Docker Compose
services:
memos:
image: neosmemo/memos:stable
container_name: memos
volumes:
- memos:/var/opt/memos
environment:
- SERVICE_FQDN_MEMOS_5230
@luizbills
luizbills / code.js
Last active December 1, 2024 22:37
Sharingan made with litecanvas #javascript #canvas #creative-coding
litecanvas()
function init() {
i = 0
}
function update(dt) {
// animation
// i += 45 * dt
}
@luizbills
luizbills / code.php
Last active November 26, 2024 17:29
Coluna de rastreio do correios na tela de pedidos do cliente
<?php
/**
* @param string[] $cols
* @return string[]
*/
add_filter( 'woocommerce_account_orders_columns', function ( $cols ) {
$enabled = apply_filters( 'woocommerce_correios_enable_tracking_history', false );
if ( $enabled ) {
$new_cols = [];
@luizbills
luizbills / code.js
Created October 18, 2024 19:25
Litecanvas sprite wobble effect
// requires https://github.com/litecanvas/utils
import { tween } from '@litecanvas/utils'
/**
* @param {Actor} target
* @param {Function} callback
*/
function wobble(target, callback = null) {
tween(target.scale, 'x', 1.5, 0.3, BACK_IN)
.chain(
@luizbills
luizbills / gameboy.md
Last active March 17, 2025 12:48
Game Boy Resolutions

Game Boy Resolutions

Game Boy (classic) and Game Boy Color

160x144 pixels (10:9 aspect ratio)

Game Boy Advance

240x160 pixels (3:2 aspect ratio)

@luizbills
luizbills / code.js
Last active June 25, 2025 19:22
How to create a tiled background image in litecanvas
let bg, tile
litecanvas()
function init() {
loadImage('https://placehold.co/128', (res) => {
tile = res
bg = paint(W, H, () => {
// cache the tiled image
tiled(0, 0, W, H, tile)
@luizbills
luizbills / code.js
Last active August 12, 2024 14:08
hello world in litecanvas
litecanvas()
function draw () {
cls(0)
text(0, 0, 'Hello World')
}