Starpelly

I said I would write another tutorial someday.


Honestly, Beef has been one of my most favorite languages to work with in the past few months, even more than C#!

Beef is compiled with no GC, and while I could probably write a whole post on how much I loathe garbage collectors, just know it makes the language really fast.

If you're already familiar with C# (as I was), you can start using Beef pretty much instantly.

More info on it here.


Hoping to increase awareness of the language, I created a very small and simple guide that demonstrates how to use one of my favorite game frameworks, Raylib, alongside one of my favorite languages.

I'm not going to go over the more advanced stuff. The Beef Documentation covers most questions you may have. You can also join the BeefLang Discord server and ask for help there.


Tutorial

First, Download and install Beef. If you're reading before version 1.0, I would recommend using the Nightly Releases. They may already include fixes for bugs you could encounter and the latest features.

Now that you have Beef installed, open the Beef IDE, and you should see something that looks like this:

(Recent Projects blocked out for secrecy...)

Click the "Create Workspace" button, and select the folder you want to create your workspace in. Note: The name of the folder is what the initial startup project will be called.

A workspace in Beef is similar to a solution in C#, it contains all the projects inside your main project.

Press "Ctrl+Shift+S" to save your solution and everything in it.

Currently your project is empty. If you try to run your project by pressing "F5", the IDE will ask if you want to auto-generate startup code because there is none. Select "Yes".

If you press "F5" now, a console window will appear and quickly disappear. Congratulations, you have just created your first Beef program!

Let's install Raylib so that we can use it with Beef.

Raylib is written in C, so to use it we're going to have to write some bindings for it. Luckily, I already did that which you can clone from GitHub.

Extract the code to a folder and keep it in a safe place. We only need the "raylib-beef" folder for all purposes covered in this tutorial, so don't worry about any of the other folders or files.

Right-click on "Workspace" (not the tab) and select "Add Existing Project".

Go to the safe place where you stored the "raylib-beef" folder, and inside of it, and double-click on the "BeefProj.toml" file.

You should now see "raylib-beef" in your workspace panel.

Right-click on your main project and select "Properties...".

From there, select "Dependencies" from under the "General" dropdown and click the checkbox next to "raylib-beef".

You are now ready to use Raylib with Beef! I wrote a sample program that draws the raylib-beef logo to the window.

Copy and paste this into "Program.bf" under your main project and press "F5" to run.

using System;
using RaylibBeef;
using static RaylibBeef.Raylib;

namespace example; // Replace with your project name.

class Program
{
    public static int Main(String[] args)
    {
        InitWindow(800, 600, "Raylib Beef 4.5");

        var beefMain = Color(165, 47, 78, 255);
        var beefOutline = Color(243, 157, 157, 255);

        while (!WindowShouldClose())
        {
            BeginDrawing();
            
            ClearBackground(RAYWHITE);

            DrawRectangle(GetScreenWidth() / 2 - 128, GetScreenHeight() / 2 - 128, 256, 256, beefOutline);
            DrawRectangle(GetScreenWidth() / 2 - 112, GetScreenHeight() / 2 - 112, 224, 224, beefMain);

            DrawText("raylib", GetScreenWidth() / 2 - 44, GetScreenHeight() / 2, 50, beefOutline);
            DrawText("beef", GetScreenWidth() / 2 - 62, GetScreenHeight() / 2 + 46, 50, beefOutline);

            DrawRectangle(GetScreenWidth() / 2 + 54, GetScreenHeight() / 2 + 54, 42, 42, beefOutline);
            DrawRectangle(GetScreenWidth() / 2 + 62, GetScreenHeight() / 2 + 62, 26, 26, RAYWHITE);

            DrawCircle(GetMouseX(), GetMouseY(), 20, beefOutline);
            DrawCircle(GetMouseX(), GetMouseY(), 8, beefMain);

            DrawFPS(20, 20);

            EndDrawing();
        }
        CloseWindow();

        return 0;
    }
}


Have fun!

Hello, It's been quite a while, hasn't it? Over a year since my last update on anything.

Let's start with an update on the Motionmelody editor. It's completely different now, with a waveform and full undo-redo support. We can finally make Darude - Sandstorm properly.

At this point, I'm about 60% done with the game. It's taking me a little longer than I would've liked, but it's definitely better than what I showed before.

Alright, first off let’s get some things straight: I have almost no idea what I’m doing; NOT.

I’ve probably made at least 12 rhythm games at this point, most didn’t make it past 3 months in development, but I’m feeling good about this one. I’m investing a lot of time into it, but I’m confident that this will be eventually finished.

Introducing Rhythm Heaven Movie Maker (name possibly not final)

Note that there is a lot in this screenshot I plan to change, but the point is that I’m really happy with how it looks right now.

Now, the purpose of this program is to create visuals for Rhythm Heaven Custom Remixes. While there is an audio editor for those, this is specifically for visuals.

I originally started it to help me make some visuals for a remix I was making. I’m deciding to expand it the more use cases I need for my videos. So I probably won’t be working on it full time as far as I’m concerned.

The code is very dynamic and I have a function for pretty much every use case I would need, so implementing things is just a matter of time and how fast I am at animating.

Here’s the Update code for Working Dough:

Alright so some info on Motionmelody.

First off, the concept of the game is officially one year old, not the game itself. But the idea for it, so that counts in some cosmic way, right?

Anyway, a lot has happened since the last time I showed anything regarding Motionmelody/Gridbeats. So I'm gonna make a quick highlight showcase.

Selection system in level editor

Old screenshot but this shows what the gameplay could look like

That's all I have for this post see you next month or whenever I decide to update this!

a

← Wander back Page 1 of 3

Last Updated: July 20th, 2023