Centered helipad building, added barracks and helipad.

This commit is contained in:
2019-11-20 17:45:41 -06:00
parent 8be8fdb225
commit fa0eabd52f
8 changed files with 95 additions and 49 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 694 B

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -16,7 +16,7 @@
id="svg134"
sodipodi:docname="helipad.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
inkscape:export-filename="/home/cyberarm/Code/i-mic-rts/assets/buildings/helipad/helipad_overlay.png"
inkscape:export-filename="/home/cyberarm/Code/i-mic-rts/assets/buildings/helipad/helipad_shell.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<defs
@@ -46,11 +46,11 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="-2.420726"
inkscape:cy="46.325261"
inkscape:cx="19.007845"
inkscape:cy="41.222516"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
showgrid="true"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
@@ -70,11 +70,16 @@
inkscape:snap-page="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
inkscape:window-width="1920"
inkscape:window-height="1006"
inkscape:window-width="1600"
inkscape:window-height="834"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid1061"
empspacing="8" />
</sodipodi:namedview>
<metadata
id="metadata131">
<rdf:RDF>
@@ -83,7 +88,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
@@ -94,53 +99,56 @@
transform="translate(0,-271.60001)">
<path
style="fill:#ce5c00;stroke:#000000;stroke-width:1;filter:url(#filter8585)"
d="m 46.25,18.892578 c -4.250756,-4.75e-4 -7.696999,5.485118 -7.697266,9.785156 9.34e-4,0.432665 0.03752,0.864499 0.109375,1.291016 -6.793419,2.331344 -12.139333,7.654215 -14.5,14.4375 -0.430703,-0.0778 -0.867179,-0.118316 -1.304687,-0.121094 -4.251511,-4.76e-4 -9.698066,3.486309 -9.697266,7.78711 2.67e-4,4.300038 5.44651,7.785631 9.697266,7.785156 0.443213,1.74e-4 0.885613,-0.03838 1.322266,-0.115234 2.356686,6.782948 7.698048,12.107748 14.488281,14.443359 -0.07318,0.422493 -0.111725,0.850382 -0.115235,1.279297 2.67e-4,4.300038 3.44651,9.785631 7.697266,9.785156 4.250756,4.75e-4 7.696999,-5.485118 7.697266,-9.785156 -0.001,-0.435982 -0.03828,-0.871106 -0.111328,-1.300782 6.787242,-2.332729 12.128066,-7.651954 14.488281,-14.429687 0.435143,0.07925 0.876228,0.120415 1.318359,0.123047 4.250756,4.76e-4 9.696999,-3.485118 9.697266,-7.785156 8e-4,-4.300801 -5.445755,-7.787586 -9.697266,-7.78711 -0.443269,4.71e-4 -0.885669,0.03968 -1.322266,0.117188 -2.356182,-6.783693 -7.69762,-12.10929 -14.488281,-14.445313 0.07318,-0.422493 0.111725,-0.850382 0.115235,-1.279297 -2.67e-4,-4.300038 -3.44651,-9.785631 -7.697266,-9.785156 z"
transform="matrix(0.26458332,0,0,0.26458332,0,271.60001)"
d="m 46.25,18.892578 c -4.250756,-4.75e-4 -7.696999,5.485118 -7.697266,9.785156 9.34e-4,0.432665 0.03752,0.864499 0.109375,1.291016 -6.793419,2.331344 -12.139333,7.654215 -14.5,14.4375 -0.430703,-0.0778 -0.867179,-0.118316 -1.304687,-0.121094 -4.251511,-4.76e-4 -9.698066,3.486309 -9.697266,7.78711 2.67e-4,4.300038 5.44651,7.785631 9.697266,7.785156 0.443213,1.74e-4 0.885613,-0.03838 1.322266,-0.115234 2.356686,6.782948 7.698048,12.107748 14.488281,14.443359 -0.07318,0.422493 -0.111725,0.850382 -0.115235,1.279297 2.67e-4,4.300038 3.44651,9.785631 7.697266,9.785156 4.250756,4.75e-4 7.696999,-5.485118 7.697266,-9.785156 -10e-4,-0.435982 -0.03828,-0.871106 -0.111328,-1.300782 6.787242,-2.332729 12.128066,-7.651954 14.488281,-14.429687 0.435143,0.07925 0.876228,0.120415 1.318359,0.123047 4.250756,4.76e-4 9.696999,-3.485118 9.697266,-7.785156 8e-4,-4.300801 -5.445755,-7.787586 -9.697266,-7.78711 -0.443269,4.71e-4 -0.885669,0.03968 -1.322266,0.117188 -2.356182,-6.783693 -7.69762,-12.10929 -14.488281,-14.445313 0.07318,-0.422493 0.111725,-0.850382 0.115235,-1.279297 -2.67e-4,-4.300038 -3.44651,-9.785631 -7.697266,-9.785156 z"
transform="matrix(0.26458332,0,0,0.26458332,0.46302091,270.52281)"
id="path140"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccccccccc" />
<circle
style="fill:#fcaf3e;stroke:#000000;stroke-width:0.26458332;filter:url(#filter8581)"
id="path1045"
cx="12.376776"
cy="285.23511"
cx="12.839797"
cy="284.1579"
r="4.3692036" />
<rect
style="fill:#a40000;stroke:#000000;stroke-width:0.26458332"
id="rect947"
width="2.1166666"
height="2.1166666"
x="11.178645"
y="284.31891" />
<rect
style="fill:#a40000;stroke:#000000;stroke-width:0.26458332"
id="rect947-3"
width="2.1166666"
height="2.1166666"
x="11.178645"
y="280.24622" />
<rect
style="fill:#a40000;stroke:#000000;stroke-width:0.26458332"
id="rect947-6"
width="2.1166666"
height="2.1166666"
x="11.178645"
y="288.39157" />
<rect
style="fill:#a40000;stroke:#000000;stroke-width:0.26458332"
id="rect947-3-7"
width="2.1166666"
height="2.1166666"
x="284.27167"
y="-17.367996"
transform="rotate(90)" />
<rect
style="fill:#a40000;stroke:#000000;stroke-width:0.26458332"
id="rect947-6-5"
width="2.1166666"
height="2.1166666"
x="284.27167"
y="-9.2226257"
transform="rotate(90)" />
<g
id="g1084">
<rect
y="283.2417"
x="11.641666"
height="2.1166666"
width="2.1166666"
id="rect947"
style="fill:#a40000;stroke:#000000;stroke-width:0.26458332" />
<rect
y="279.16901"
x="11.641666"
height="2.1166666"
width="2.1166666"
id="rect947-3"
style="fill:#a40000;stroke:#000000;stroke-width:0.26458332" />
<rect
y="287.31436"
x="11.641666"
height="2.1166666"
width="2.1166666"
id="rect947-6"
style="fill:#a40000;stroke:#000000;stroke-width:0.26458332" />
<rect
transform="rotate(90)"
y="-17.831017"
x="283.19446"
height="2.1166666"
width="2.1166666"
id="rect947-3-7"
style="fill:#a40000;stroke:#000000;stroke-width:0.26458332" />
<rect
transform="rotate(90)"
y="-9.685647"
x="283.19446"
height="2.1166666"
width="2.1166666"
id="rect947-6-5"
style="fill:#a40000;stroke:#000000;stroke-width:0.26458332" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@@ -0,0 +1,9 @@
IMICRTS::Entity.define_entity(:barracks, :building, 400, "Builds and soldiers") do |entity|
entity.radius = 44
entity.max_health = 100.0
entity.shell_image = "buildings/barracks/barracks.png"
entity.on_tick do
end
end

View File

@@ -0,0 +1,10 @@
IMICRTS::Entity.define_entity(:helipad, :building, 1_000, "Builds and rearms helicopters") do |entity|
entity.radius = 26
entity.max_health = 100.0
entity.shell_image = "buildings/helipad/helipad_shell.png"
entity.overlay_image = "buildings/helipad/helipad_overlay.png"
entity.on_tick do
end
end

View File

@@ -46,6 +46,7 @@ class IMICRTS
raise "Failed to find entity #{name.inspect} definition"
end
@boid_radius = @radius + 8
component(:turret).angle = @angle if component(:turret)
@goal_color = Gosu::Color.argb(175, 25, 200, 25)
@@ -149,6 +150,7 @@ class IMICRTS
def draw_radius
Gosu.draw_circle(@position.x, @position.y, @radius, ZOrder::ENTITY_RADIUS, @player.color, 360 / 18)
Gosu.draw_circle(@position.x, @position.y, @boid_radius, ZOrder::ENTITY_RADIUS, @player.color, 360 / 18)
end
def draw_gizmos

View File

@@ -1,6 +1,7 @@
class IMICRTS
class Closing < CyberarmEngine::GuiState
def setup
window.show_cursor = false
@logo = Gosu::Image.new("#{ASSETS_PATH}/logo.png")
@color = Gosu::Color.new(0xffffffff)

View File

@@ -107,6 +107,22 @@ class IMICRTS
position: CyberarmEngine::Vector.new(spawnpoint.x + 130, spawnpoint.y - 64, ZOrder::BUILDING),
angle: 0
)
@player.entities << Entity.new(
name: :helipad,
director: @director,
player: @player,
id: @player.next_entity_id,
position: CyberarmEngine::Vector.new(spawnpoint.x - 32, spawnpoint.y - 96, ZOrder::BUILDING),
angle: 0
)
@player.entities << Entity.new(
name: :barracks,
director: @director,
player: @player,
id: @player.next_entity_id,
position: CyberarmEngine::Vector.new(spawnpoint.x - 32, spawnpoint.y + 128, ZOrder::BUILDING),
angle: 0
)
end
def draw