Skip to content

Commit 4b56226

Browse files
committed
Fix Ahorn entity .jl paths
1 parent f53298c commit 4b56226

File tree

5 files changed

+154
-0
lines changed

5 files changed

+154
-0
lines changed

Ahorn/Entities/caveWall.jl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module SpringCollab2020CaveWall
2+
3+
using ..Ahorn, Maple
4+
5+
@mapdef Entity "SpringCollab2020/caveWall" CaveWall(x::Integer, y::Integer, width::Integer=Maple.defaultBlockWidth, height::Integer=Maple.defaultBlockHeight, tiletype::String="3")
6+
7+
const placements = Ahorn.PlacementDict(
8+
"Cave Wall (Spring Collab 2020)" => Ahorn.EntityPlacement(
9+
CaveWall,
10+
"rectangle",
11+
Dict{String, Any}(),
12+
Ahorn.tileEntityFinalizer
13+
),
14+
)
15+
16+
Ahorn.editingOptions(entity::CaveWall) = Dict{String, Any}(
17+
"tiletype" => Ahorn.tiletypeEditingOptions()
18+
)
19+
20+
Ahorn.minimumSize(entity::CaveWall) = 8, 8
21+
Ahorn.resizable(entity::CaveWall) = true, true
22+
23+
Ahorn.selection(entity::CaveWall) = Ahorn.getEntityRectangle(entity)
24+
25+
Ahorn.renderAbs(ctx::Ahorn.Cairo.CairoContext, entity::CaveWall, room::Maple.Room) = Ahorn.drawTileEntity(ctx, room, entity, alpha=0.7)
26+
27+
end

Ahorn/Entities/dashSpring.jl

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module SpringCollab2020FloatierSpaceBlock
2+
3+
using ..Ahorn, Maple
4+
5+
@mapdef Entity "SpringCollab2020/floatierSpaceBlock" FloatierSpaceBlock(x::Integer, y::Integer, width::Integer=Maple.defaultBlockWidth, height::Integer=Maple.defaultBlockHeight, tiletype::String="3", disableSpawnOffset::Bool=false, floatinessMultiplier::Number=1, bounceBackMultiplier::Number=1)
6+
7+
const placements = Ahorn.PlacementDict(
8+
"Floatier Space Block (Spring Collab 2020)" => Ahorn.EntityPlacement(
9+
FloatierSpaceBlock,
10+
"rectangle",
11+
Dict{String, Any}(),
12+
Ahorn.tileEntityFinalizer
13+
)
14+
)
15+
16+
Ahorn.editingOptions(entity::FloatierSpaceBlock) = Dict{String, Any}(
17+
"tiletype" => Ahorn.tiletypeEditingOptions()
18+
)
19+
20+
Ahorn.minimumSize(entity::FloatierSpaceBlock) = 8, 8
21+
Ahorn.resizable(entity::FloatierSpaceBlock) = true, true
22+
23+
Ahorn.selection(entity::FloatierSpaceBlock) = Ahorn.getEntityRectangle(entity)
24+
25+
Ahorn.renderAbs(ctx::Ahorn.Cairo.CairoContext, entity::FloatierSpaceBlock, room::Maple.Room) = Ahorn.drawTileEntity(ctx, room, entity)
26+
27+
end
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module SpringCollab2020InvisibleLightSource
2+
3+
using ..Ahorn, Maple
4+
5+
@mapdef Entity "SpringCollab2020/invisibleLightSource" InvisibleLightSource(x::Integer, y::Integer, alpha::Number=1, radius::Number=48, startFade::Number=24, endFade::Number=48, color::String="White")
6+
7+
const colors = sort(collect(keys(Ahorn.XNAColors.colors)))
8+
9+
const placements = Ahorn.PlacementDict(
10+
"Light Source (Spring Collab 2020)" => Ahorn.EntityPlacement(
11+
InvisibleLightSource
12+
)
13+
)
14+
15+
Ahorn.editingOptions(entity::InvisibleLightSource) = Dict{String,Any}(
16+
"color" => colors
17+
)
18+
19+
function Ahorn.selection(entity::InvisibleLightSource)
20+
x, y = Ahorn.position(entity)
21+
22+
return Ahorn.Rectangle(x - 4, y - 4, 7, 8)
23+
end
24+
25+
function Ahorn.renderAbs(ctx::Ahorn.Cairo.CairoContext, entity::InvisibleLightSource, room::Maple.Room)
26+
x, y = Ahorn.position(entity)
27+
sprite = Ahorn.getTextureSprite("objects/hanginglamp", "Gameplay")
28+
29+
Ahorn.drawImage(ctx, sprite, x - 4, y - 4, 0, 16, 7, 8, alpha=0.7)
30+
end
31+
32+
end
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module SpringCollab2020DiagonalWingedStrawberry
2+
using ..Ahorn, Maple
3+
@mapdef Entity "SpringCollab2020/diagonalWingedStrawberry" DiagonalWingedStrawberry(x::Integer, y::Integer, order::Integer=-1, checkpointID::Integer=-1)
4+
5+
const placements = Ahorn.PlacementDict(
6+
"Diagonal Winged Strawberry (Spring Collab 2020)" => Ahorn.EntityPlacement(
7+
DiagonalWingedStrawberry
8+
)
9+
)
10+
11+
function Ahorn.selection(entity::DiagonalWingedStrawberry)
12+
x, y = Ahorn.position(entity)
13+
14+
return Ahorn.getSpriteRectangle("collectables/strawberry/wings01", x, y)
15+
end
16+
17+
function Ahorn.renderAbs(ctx::Ahorn.Cairo.CairoContext, entity::DiagonalWingedStrawberry, room::Maple.Room)
18+
x, y = Ahorn.position(entity)
19+
20+
Ahorn.drawSprite(ctx, "collectables/strawberry/wings01", x, y)
21+
end
22+
23+
end

0 commit comments

Comments
 (0)