A downloadable engine for Windows and Linux

Download NowName your own price

tophat

Tophat is a friendly game library for making 2d games with umka.

examples

Rectangle you can control with arrows:

import ("th.um"; "rect.um"; "input.um"; "canvas.um"; "window.um")
fn main() {
    const speed = 100
    window.setup("my game", 400, 400)
    window.setViewport(th.Vf2{200, 200})
    pos := th.Vf2{100, 100}
    for window.cycle(cam) {
        var change: th.Vf2
        // Handle input
        if input.isPressed(input.key_left)  { change.x -= 1 }
        if input.isPressed(input.key_right) { change.x += 1 }
        if input.isPressed(input.key_up)    { change.y -= 1 }
        if input.isPressed(input.key_down)  { change.y += 1 }
        // Apply movement
        pos = pos.add(change.norm().mulf(speed * th.delta / 1000.0))
        // Draw!
        canvas.drawRect(th.green, rect.mk(pos.x, pos.y, 10, 10))
    }
}

Draw image:

import ("window.um"; "image.um"; "th.um")
fn main() {
    window.setup("image drawing", 400, 400)
    img := image.load("my-image.png")
    
    for window.cycle() {
        img.draw(th.mkTransform(th.Vf2{ 0, 0 }))
    }
}

You can browse more examples in the examples/ directory.

Download

Download NowName your own price

Click download now to get access to the following files:

tophat-windows-v13.exe 1.6 MB
tophat-linux-v13 1.6 MB

Development log

Comments

Log in with itch.io to leave a comment.

Hello . Just found out about this game engine. I wanted a good game engine for Game Jams (I think this is perfect). 

What is the fastest way for me to learn umka?

btw , I recommed adding the tag "tophat" to your game (RAIDER)

Also, what IDE do I use to write umka code?

Sorry for late replies.

> What is the fastest way for me to learn umka?

I recommend looking at umka's and tophat's examples or reading the spec. Umka is a very simple languague to understand.

I use vim to edit umka which i made a syntax support for. There is also syntax support for sublime available in the main umka repo.

You can also join the discord server if you need more help.

https://discord.gg/PcT7cn59h9

Thanks :)