SenrichScript
A simple scripting language for creating games on Blue Helm Studios. Designed to be easy for beginners while remaining powerful enough for advanced projects.
Syntax
SenrichScript uses a simple readable syntax.
print("Hello World");
Statements should end with a semicolon.
Variables
var score = 0;
var playerName = "Alex";
var alive = true;
Constants
const MAX_HEALTH = 100;
const SPEED = 5;
Functions
function add(a,b){
return a+b;
}
print(add(5,3));
Math
var x = 10 + 5;
var y = 10 * 3;
var z = 2 ** 3;
Conditions
if(score >= 100){
print("You Win!");
}else{
print("Keep Going");
}
Loops
for(var i = 0; i < 10; i++){
print(i);
}
Instances
var player = Instance("Sprite");
player.x = 100;
player.y = 200;
player.image = "hero.png";
Events
player.onClick(function(){
print("Clicked!");
});
Movement
player.x += 5;
player.y += 2;
User Interface
var label = Instance("Label");
label.text = "Score: 0";
label.x = 10;
label.y = 10;
Audio
var music = Instance("Sound");
music.source = "theme.mp3";
music.play();
Animations
player.animate({
x:500,
y:200
},2);
Modules
function add(a,b){
return a+b;
}
return {
add:add
};
Example Game
var hero = Instance("Sprite");
hero.image = "hero.png";
hero.x = 50;
hero.y = 100;
function update(){
hero.x += 2;
}
game.onUpdate(update);