2024-02-26 17:04:37 -08:00
|
|
|
load("@bazel_skylib//rules:run_binary.bzl", "run_binary")
|
2024-02-28 16:10:09 -08:00
|
|
|
load("helpers.bzl", "add_sprites")
|
2024-02-26 17:04:37 -08:00
|
|
|
|
2024-02-25 13:49:21 -08:00
|
|
|
cc_library(
|
|
|
|
name = "game",
|
2024-02-27 15:57:37 -08:00
|
|
|
srcs = glob(["*.c"]) + [
|
2024-02-28 16:10:09 -08:00
|
|
|
"art/game_collectibles.c",
|
2024-02-29 12:08:50 -08:00
|
|
|
"art/game_hud.c",
|
2024-02-28 19:42:03 -08:00
|
|
|
"art/game_npcs.c",
|
2024-02-27 15:57:37 -08:00
|
|
|
"art/game_player.c",
|
|
|
|
"art/game_tiles.c",
|
|
|
|
"map/game_map.c",
|
2024-02-28 13:14:48 -08:00
|
|
|
"map/game_map_entities.c",
|
2024-02-27 15:57:37 -08:00
|
|
|
],
|
|
|
|
hdrs = glob(["*.h", "art/*.h", "map/*.h"]),
|
2024-02-25 16:40:33 -08:00
|
|
|
visibility = ["//visibility:public"],
|
2024-02-25 18:38:53 -08:00
|
|
|
deps = ["//device:device", "//sys:sys"]
|
2024-02-26 17:04:37 -08:00
|
|
|
)
|
|
|
|
|
2024-02-28 16:10:09 -08:00
|
|
|
add_sprites(name="game_collectibles", n=24)
|
2024-02-29 12:08:50 -08:00
|
|
|
add_sprites(name="game_hud", n=2)
|
2024-02-28 16:10:09 -08:00
|
|
|
add_sprites(name="game_player", n=96)
|
2024-02-28 19:05:52 -08:00
|
|
|
add_sprites(name="game_npcs", n=64)
|
2024-02-28 16:10:09 -08:00
|
|
|
add_sprites(name="game_tiles", n=120)
|
2024-02-26 19:51:26 -08:00
|
|
|
|
|
|
|
run_binary(
|
|
|
|
name = "game_map",
|
|
|
|
args = [
|
|
|
|
"game_map",
|
2024-02-27 15:09:51 -08:00
|
|
|
"$(location :map/game_map.ldtk)",
|
2024-02-26 19:51:26 -08:00
|
|
|
"$(location :map/game_map.c)",
|
|
|
|
],
|
2024-02-27 15:09:51 -08:00
|
|
|
srcs = [":map/game_map.ldtk"],
|
2024-02-26 19:51:26 -08:00
|
|
|
outs = [":map/game_map.c"],
|
|
|
|
tool = "//pytools:mapdata"
|
2024-02-25 16:40:33 -08:00
|
|
|
)
|