No Description

AnXPyDev d5da09183d Working on looping polygons 5 years ago
base 40a150389a saving progress in scene director 5 years ago
icon 91e63feaf6 da 6 years ago
scripts 68ac0a618c playing same sound multiple times at once supported 5 years ago
src d5da09183d Working on looping polygons 5 years ago
tools 717d92601f adding more features 5 years ago
.gitignore 26d57d5175 restructured minty folder 5 years ago
LICENSE 31dd1823d8 added license 5 years ago
README.md ead6a8c655 Update README.md 5 years ago
build.sh e77cccde58 can build with developer mode 5 years ago
compile.sh 356776a1d9 can set render resolution 5 years ago
package.json abd627c671 updated dependencies 5 years ago
run.sh 3bc12dbf9e Merge remote-tracking branch 'origin/master' 5 years ago
tsconfig.json 717d92601f adding more features 5 years ago

README.md

minty

minty is a simple game engine inspired by Game Maker Studio

Requirements:

Node.js + npm (newest version recommended)

Git + Git Bash

Installation guide:

Create a folder and open git bash in it, then run these commands

$ git clone https://github.com/AnXPyDev/minty.git

$ cd ./minty

$ npm install 

$ bash compile.sh (you may insert the name of a project here)

$ bash run.sh

Examples:

https://github.com/AnXPyDev/minty-projects

Packaging the app:

$ bash build.sh (insert name of project here)

You will find the packaged project in the "built" folder inside the folder that contains minty

Using minty:

Creating a simple pong game.

// Initialize a Scene
const s0 = new Scene("s0", v(640, 640), 
{
    // Spawn objects
    paddle:[[]],
    paddle_ai:[[]],
    ball:[[]]
},
{
    // Spawn background
    main:["noimage", "solid", "black"]
},() => {
    // Resize viewport to custom size
    vport.resize(v(640,640));
},() => {}, 60, 60)

GAME.onload = function() {
    // Load scene when game is ready to be loaded
    s0.load();
}

// Define an actor 
def("paddle", class extends Actor {
    constructor() {
        super(v(-280), "paddle");
        this.speed = 8;
        this.size = v(8,64);
    }
    tick() {
        this.pos.y = lerp(this.pos.y, Mouse.y, 0.1);
    }
    draw() {
        Draw.rect(this.size, this.pos, "white");
    }
}, ["paddle"]);

def("paddle_ai", class extends act.paddle {
    constructor() {
        super();
        this.name = "paddle_ai";
        this.pos.x = 280;
    }
    tick() {
        this.pos.y = clamp(approach(this.pos.y, Instance.get("ball", 0).pos.y, this.speed), -320, 320);
    }
}, ["paddle"]);

def("ball", class extends Actor {
    constructor() {
        super(v(), "ball");
        this.dir = v(Random.int(4,8),Random.int(4,8));
        this.size = v(8,8);
    }
    tick() {
        // Invert direction when hitting paddle
        if(collides(this, Instance.filter(["paddle"])).is) {
            this.dir.x *= -1;
        }
        // Check for hitting ceiling or fllor
        if (this.pos.y < -320 || this.pos.y > 320) {
            this.dir.y *= -1;
        }
        // Check for going behind a paddle
        if(this.pos.x < -320 || this.pos.x > 320) {
            s0.load();
        }
        this.pos.x += this.dir.x;
        this.pos.y += this.dir.y;
    }
    draw() {
        Draw.ellipse(this.size, this.pos, "white");
    }
});