summary refs log tree commit diff stats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp index c23897b..b1fc373 100644 --- a/src/main.cpp +++ b/src/main.cpp
@@ -47,11 +47,13 @@ void loop(Renderer& renderer) {
47 game.getSystem<AnimationSystem>().initSprite(boneySprite, "../res/sprites/boney_anim.txt", renderer); 47 game.getSystem<AnimationSystem>().initSprite(boneySprite, "../res/sprites/boney_anim.txt", renderer);
48 game.getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, boneySprite); 48 game.getSystem<CharacterSystem>().addSpriteToParty(lucasSprite, boneySprite);
49 49
50 int flintSprite = game.emplaceSprite("flint"); 50 for (const Prototype& p : game.getMap().getPrototypes()) {
51 game.getSystem<TransformSystem>().initSprite(flintSprite, {35*16, 19*16}); 51 int spriteId = game.emplaceSprite(p.name);
52 game.getSystem<TransformSystem>().setUpCollision(flintSprite, {-8, -8}, {12, 8}); 52 game.getSystem<TransformSystem>().initSprite(spriteId, p.pos);
53 game.getSystem<AnimationSystem>().initSprite(flintSprite, "../res/sprites/flint_anim.txt", renderer); 53 game.getSystem<TransformSystem>().setUpCollision(spriteId, p.collisionOffset, p.collisionSize);
54 game.getSprite(flintSprite).interactionScript = "script0001"; 54 game.getSystem<AnimationSystem>().initSprite(spriteId, p.animationFilename, renderer);
55 game.getSprite(spriteId).interactionScript = p.interactionScript;
56 }
55 57
56 game.getSystem<CameraSystem>().setFollowingSprite(lucasSprite); 58 game.getSystem<CameraSystem>().setFollowingSprite(lucasSprite);
57 game.getSystem<CameraSystem>().unlockCamera(); 59 game.getSystem<CameraSystem>().unlockCamera();