VoxelCodingLanguage


Why i’m creating VoxelCodingLanguage

I recently thought that having mods in my voxel game would be amazing. The big issue thought was the fact that i’m a maniac who makes my engine in pure c with pointers and whatever most people find boring.

considering most people find c boring i decided to create a custom language wich can get converted into c and compiled its pretty simple and looks like a high level coding language.

How does it look ?

here is the code i was testing with :

class Sand:
    altitude : float
    velocity : float

    fn init:
        self.altitude = 100.0
        self.velocity = 0.0
        self.add_tag("physics_object")
        print "Sand particle initialized internally!"

    fn fall:
        self.velocity += 1.5
        self.altitude -= self.velocity
        
        print "Falling... Altitude is now:"
        print self.altitude
        
        if self.altitude <= 0.0:
            print "*** Hit the ground! ***"
            self.altitude = 0.0
            self.velocity = 0.0

# 1. We declare our Sand particle globally
global my_sand : Sand*

# 2. VCL Engine initialization step
init:
    print "--- Booting VCL Module ---"
    my_sand.init()

# 3. VCL Engine loop
tick:
    print "--- Engine Tick ---"
    my_sand.fall()

it then gets converted into c and when i compile i can use it within a loop. here is the result when testing

==================================
   Starting Voxel Engine (Host)   
==================================
--- Booting VCL Module ---
Sand particle initialized internally!
--- Engine Tick ---
Falling... Altitude is now:
98.500000
--- Engine Tick ---
Falling... Altitude is now:
95.500000
--- Engine Tick ---
Falling... Altitude is now:
91.000000
--- Engine Tick ---
Falling... Altitude is now:
85.000000
--- Engine Tick ---
Falling... Altitude is now:
77.500000
--- Engine Tick ---
Falling... Altitude is now:
68.500000
Engine shutting down...```

Get RAZE-CORE!

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.