1+ module SpringCollab2020DashSpring
2+
3+ using .. Ahorn, Maple
4+
5+ @mapdef Entity " SpringCollab2020/dashSpring" DashSpring(x:: Integer , y:: Integer , playerCanUse:: Bool = true )
6+ @mapdef Entity " SpringCollab2020/wallDashSpringRight" DashSpringRight(x:: Integer , y:: Integer )
7+ @mapdef Entity " SpringCollab2020/wallDashSpringLeft" DashSpringLeft(x:: Integer , y:: Integer )
8+
9+ const placements = Ahorn. PlacementDict(
10+ " Dash Spring (Up, Spring Collab 2020)" => Ahorn. EntityPlacement(
11+ DashSpring
12+ ),
13+ " Dash Spring (Left, Spring Collab 2020)" => Ahorn. EntityPlacement(
14+ DashSpringRight
15+ ),
16+ " Dash Spring (Right, Spring Collab 2020)" => Ahorn. EntityPlacement(
17+ DashSpringLeft
18+ ),
19+ )
20+
21+ function Ahorn. selection(entity:: DashSpring )
22+ x, y = Ahorn. position(entity)
23+
24+ return Ahorn. Rectangle(x - 6 , y - 3 , 12 , 5 )
25+ end
26+
27+ function Ahorn. selection(entity:: DashSpringLeft )
28+ x, y = Ahorn. position(entity)
29+
30+ return Ahorn. Rectangle(x - 1 , y - 6 , 5 , 12 )
31+ end
32+
33+ function Ahorn. selection(entity:: DashSpringRight )
34+ x, y = Ahorn. position(entity)
35+
36+ return Ahorn. Rectangle(x - 4 , y - 6 , 5 , 12 )
37+ end
38+
39+ sprite = " objects/SpringCollab2020/dashSpring/00.png"
40+
41+ Ahorn. render(ctx:: Ahorn.Cairo.CairoContext , entity:: DashSpring , room:: Maple.Room ) = Ahorn. drawSprite(ctx, sprite, 0 , - 8 )
42+ Ahorn. render(ctx:: Ahorn.Cairo.CairoContext , entity:: DashSpringLeft , room:: Maple.Room ) = Ahorn. drawSprite(ctx, sprite, 24 , 0 , rot= pi / 2 )
43+ Ahorn. render(ctx:: Ahorn.Cairo.CairoContext , entity:: DashSpringRight , room:: Maple.Room ) = Ahorn. drawSprite(ctx, sprite, - 8 , 16 , rot= - pi / 2 )
44+
45+ end
0 commit comments