<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title><![CDATA[ren focus | RSS Feed]]></title>
        <description><![CDATA[Metaphysics, tunes, and code]]></description>
        <link>https://renfoc.us</link>
        <image>
            <url>https://renfoc.us/header.webp</url>
            <title>ren focus | RSS Feed</title>
            <link>https://renfoc.us</link>
        </image>
        <generator>RSS for Node</generator>
        <lastBuildDate>Thu, 09 Apr 2026 13:03:18 GMT</lastBuildDate>
        <atom:link href="https://renfoc.us/rss.xml" rel="self" type="application/rss+xml"/>
        <pubDate>Thu, 09 Apr 2026 13:03:18 GMT</pubDate>
        <copyright><![CDATA[All rights reserved 2026]]></copyright>
        <item>
            <title><![CDATA[the race down]]></title>
            <description><![CDATA[...Maybe ten....]]></description>
            <link>https://renfoc.us/posts/1774107059-the_race_down</link>
            <guid isPermaLink="true">https://renfoc.us/posts/1774107059-the_race_down</guid>
            <pubDate>Sat, 21 Mar 2026 15:30:59 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[my review of metroid fusion]]></title>
            <description><![CDATA[...I knew how it ended....]]></description>
            <link>https://renfoc.us/posts/1771544324-my_review_of_metroid_fusion</link>
            <guid isPermaLink="true">https://renfoc.us/posts/1771544324-my_review_of_metroid_fusion</guid>
            <pubDate>Thu, 19 Feb 2026 23:38:44 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[the backlog and existence]]></title>
            <description><![CDATA[...Every hour, new media pops up and our schedule forces us into a pact with our own happiness: I will make time for this later....]]></description>
            <link>https://renfoc.us/posts/1769188897-the_backlog_and_existence</link>
            <guid isPermaLink="true">https://renfoc.us/posts/1769188897-the_backlog_and_existence</guid>
            <pubDate>Fri, 23 Jan 2026 17:21:37 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[building a js gameloop]]></title>
            <description><![CDATA[...In this post, we'll explore how to build a proper game loop using `requestAnimationFrame`, complete with frame rate limiting and state management—all based on a real working example.



Before we dive in, let's understand why `requestAnimationFrame` is the go-to choice for browser-based games:

- **Optimized for animations**: The browser calls your callback before the next repaint, ensuring smooth visuals
- **Automatic pausing**: When the tab is hidden, `requestAnimationFrame` pauses, saving CPU and battery
- **60 FPS target**: Syncs with the display's refresh rate (typically 60Hz)
- **Better than `setInterval`**: More precise timing and better performance



Let's start by building a reusable `GameLoop` class that handles the frame timing logic:

```typescript
class GameLoop {
    private lastFrameTime = 0;
    private FPS = 30;
    private FrameInterval = 1000 / this.FPS;
    private render: Function;
    private isDone = false;

    constructor(renderCallback: Function) {
        if (!window) throw new Error('global window object is required but not found');
        this.render = renderCallback;
    }

    run() {
        window.requestAnimationFrame(this.loop.bind(this));        
    }

    stop() {
        this.isDone = true;
    }

    loop(currentTime: number) {
        if (this.isDone) return;
        
        this.run();
        
        const deltaTime = currentTime - this.lastFrameTime;
        if (deltaTime >= this.FrameInterval) {
            this.lastFrameTime = currentTime - (deltaTime % this.FrameInterval);
            this.render();
        }
    }
}
```



**The Constructor**: Takes a callback function that will handle your game's rendering and logic each frame.

**The run() Method**: Kicks off the animation loop by calling `requestAnimationFrame`, which schedules the `loop` method to run before the next repaint.

**The loop() Method**: This is where the magic happens....]]></description>
            <link>https://renfoc.us/posts/1764713109-building_a_js_gameloop</link>
            <guid isPermaLink="true">https://renfoc.us/posts/1764713109-building_a_js_gameloop</guid>
            <pubDate>Tue, 02 Dec 2025 22:05:09 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[starting a supabase project]]></title>
            <description><![CDATA[...After a few minutes, I decided on [Supabase](https://supabase.com/) to handle the backend....]]></description>
            <link>https://renfoc.us/posts/1763486231-starting_a_supabase_project</link>
            <guid isPermaLink="true">https://renfoc.us/posts/1763486231-starting_a_supabase_project</guid>
            <pubDate>Tue, 18 Nov 2025 17:17:11 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[call bind or apply]]></title>
            <link>https://renfoc.us/posts/1762973191-call_bind_or_apply</link>
            <guid isPermaLink="true">https://renfoc.us/posts/1762973191-call_bind_or_apply</guid>
            <pubDate>Wed, 12 Nov 2025 18:46:31 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[this quirky javascript]]></title>
            <description><![CDATA[...My code worked....]]></description>
            <link>https://renfoc.us/posts/1762298703-this_quirky_javascript</link>
            <guid isPermaLink="true">https://renfoc.us/posts/1762298703-this_quirky_javascript</guid>
            <pubDate>Tue, 04 Nov 2025 23:25:03 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[from ad chaos to clarity]]></title>
            <description><![CDATA[...One day, she receives a complaint: a reader has spotted malicious ads on the homepage....]]></description>
            <link>https://renfoc.us/posts/1759258235-from_ad_chaos_to_clarity</link>
            <guid isPermaLink="true">https://renfoc.us/posts/1759258235-from_ad_chaos_to_clarity</guid>
            <pubDate>Tue, 30 Sep 2025 18:50:35 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[the poison within patriotism]]></title>
            <description><![CDATA[...During a group date, my date's friend wanted to go to a bar....]]></description>
            <link>https://renfoc.us/posts/1755103186-the_poison_within_patriotism</link>
            <guid isPermaLink="true">https://renfoc.us/posts/1755103186-the_poison_within_patriotism</guid>
            <pubDate>Wed, 13 Aug 2025 16:39:46 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[a haunting musical kaleidoscope]]></title>
            <description><![CDATA[...The pieces didn’t change — only their arrangement did — yet the results could be beautiful, strange, or chaotic.

Well, I took out my Moog Subharmonicon from storage and wow......]]></description>
            <link>https://renfoc.us/posts/1755014540-a_haunting_musical_kaleidoscope</link>
            <guid isPermaLink="true">https://renfoc.us/posts/1755014540-a_haunting_musical_kaleidoscope</guid>
            <pubDate>Tue, 12 Aug 2025 16:02:20 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[need more Bertrand and less Seneca]]></title>
            <description><![CDATA[...What I used to do to manage it—routine, discipline, a kind of philosophical bracing—has stopped working....]]></description>
            <link>https://renfoc.us/posts/1748907707-need_more_Bertrand_and_less_Seneca</link>
            <guid isPermaLink="true">https://renfoc.us/posts/1748907707-need_more_Bertrand_and_less_Seneca</guid>
            <pubDate>Mon, 02 Jun 2025 23:41:47 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[ai is easy with huggingface]]></title>
            <description><![CDATA[...I’m surprised more people aren’t using [Hugging Face](https://huggingface.co), a platform that makes machine learning much easier by offering pre-trained models, especially for language and text....]]></description>
            <link>https://renfoc.us/posts/1748281271-ai_is_easy_with_huggingface</link>
            <guid isPermaLink="true">https://renfoc.us/posts/1748281271-ai_is_easy_with_huggingface</guid>
            <pubDate>Mon, 26 May 2025 17:41:11 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[what happened to pwas]]></title>
            <description><![CDATA[...They are publicly agreed-upon rules and technologies—like HTML, CSS, JavaScript, and HTTP—that define how the web works....]]></description>
            <link>https://renfoc.us/posts/1746036083-what_happened_to_pwas</link>
            <guid isPermaLink="true">https://renfoc.us/posts/1746036083-what_happened_to_pwas</guid>
            <pubDate>Wed, 30 Apr 2025 18:01:23 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[the bare minimum during ai prompt design]]></title>
            <description><![CDATA[...Models, like GPT-3, which generate text based on prompts, and Google's PaLM 2 Bison, are being incorporated into many SaaS offerings....]]></description>
            <link>https://renfoc.us/posts/1725041521-the_bare_minimum_during_ai_prompt_design</link>
            <guid isPermaLink="true">https://renfoc.us/posts/1725041521-the_bare_minimum_during_ai_prompt_design</guid>
            <pubDate>Fri, 30 Aug 2024 18:12:01 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[a good commit with empathy]]></title>
            <description><![CDATA[...The best type of solution is the one that feels natural, hence invisible....]]></description>
            <link>https://renfoc.us/posts/1708455032-a_good_commit_with_empathy</link>
            <guid isPermaLink="true">https://renfoc.us/posts/1708455032-a_good_commit_with_empathy</guid>
            <pubDate>Tue, 20 Feb 2024 18:50:32 GMT</pubDate>
        </item>
    </channel>
</rss>