Commit bed8202a authored by Delisa Mason's avatar Delisa Mason

feat: Add DSL commands for screen actions

* Refactor to avoid requiring assets for transforms
* Add all_groups top-level command
* Make camera global. Use camera_follow to move.
parent 18670cd5
load_resources {
map_add("level01", "game/assets/maps/level01/init.lua"),
sprite_add("player", "game/assets/images/player.png", 0, 0, 16, 16),
--image_add("name", "image.png"),
--anim_add("name", "image.png", w, h, num_frames, duration),
sprite_add("player", "game/assets/images/player.png", 16, 0, 16, 16),
}
group {
all_groups {
map_draw("level01"),
sprite_draw("player", 300, 0, 10, 10),
map_follow("level01", "player"),
sprite_move("player", 210, 110, 8),
--sprite_rotate("player", 2.1, 10),
camera_follow("level01", "player"),
}
group {
map_draw("level01"),
sprite_draw("player", 210, 110, 10, 10),
sprite_scale("player", 1, 1, 8),
dialog(40, 10, "We are gonna crash!!"),
sprite_draw("player", 640, 120, 10, 10),
sprite_move("player", -410, 0, 4),
}
group {
sprite_draw("player", 230, 110, 10, 10),
sprite_scale("player", 1, 1, 3),
sprite_move("player", -30, 200, 3),
sprite_rotate("player", 2.1, 3),
auto_dialog(240, 10, 3, "We are gonna crash!!"),
}
group {
sprite_draw("player", 200, 310, 1, 1, 2.1),
shake_screen(1, 4, 60),
wait(3)
}
group {
sprite_draw("player", 200, 310, 1, 1, 2.1),
auto_dialog(200, 200, 4, "Where are we?"),
auto_dialog(140, 230, 4, "Let's get out of here!"),
}
group {
sprite_draw("player", 200, 310, 1, 1, 2.1),
fade_screen(1, {0, 0, 0, 255}),
}
--[[group {
sprite_draw("name", x, y),
image_draw("name", x, y),
map_follow("sprite name"),
anim_draw("name", x, y)
wait(10),
}]]
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment