Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Z7-Z7L/ZTME
Simple Tile Editor Made For Raylib In Odin
https://github.com/Z7-Z7L/ZTME
Last synced: 18 days ago
JSON representation
Simple Tile Editor Made For Raylib In Odin
- Host: GitHub
- URL: https://github.com/Z7-Z7L/ZTME
- Owner: Z7-Z7L
- License: mit
- Created: 2024-04-17T18:52:59.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-04-21T14:24:46.000Z (8 months ago)
- Last Synced: 2024-04-22T13:01:18.634Z (8 months ago)
- Language: Odin
- Size: 3.66 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-odin - ZTME - Z7L/ZTME?tab=MIT-1-ov-file#readme) | Gamedev, 2D, Utility, Editor, Raylib (Libraries / Gamedev)
- awesome-odin - ZTME - Z7L/ZTME?tab=MIT-1-ov-file#readme) | Gamedev, 2D, Utility, Editor, Raylib (Libraries / Gamedev)
README
# ZTME
My own tile editor for raylibTo use run `ZTME.exe` and it will start the editor
NOTE: the Grid Mode isn't working for now I will do it later
**Controls:****Show Grid:** `one` in the keyboard
**Show Hitbox:** `two` in the keyboard
**Eanble / Disable Grid Mode:** `three` in the keyboard
**Hitbox State:** `three` in the keyboard
**Save the map:** `Enter`
After you finish the map you just press `Enter` and it will save the map for you in a `map.json` (even if there is no `map.json` it will create `map.json` for you)To load the map you will need to add `tilemap.odin` to your project
Here is a example to how to load the map using `tilemap.odin`
```odin
package gameimport rl "vendor:raylib"
import "core:fmt"SCREEN_WIDTH, SCREEN_HEIGHT :: 1280, 720;
main :: proc() {
// Initialization
rl.InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "Game");
rl.SetTargetFPS(60);world: World;
world.tiles = LoadMapFromJSON("map.json")LoadTexturesToWorld(&world, "res/tiles/grass");
LoadTexturesToWorld(&world, "res/tiles/dirt");SetTilesHitbox(world);
/*** Game Loop ***/
for (!rl.WindowShouldClose()) {
/*** Draw ***/
rl.BeginDrawing();
rl.ClearBackground(rl.RAYWHITE);DrawWorld(&world, false);
// Draw FPS
rl.DrawFPS(0, 0);rl.EndDrawing();
/*** Draw ***/
}
/*** Game Loop ***/// Close the window
rl.CloseWindow();
}
```