Added boot screen, added logo

This commit is contained in:
2020-05-03 23:25:33 -05:00
parent 75185425b6
commit face4b092a
8 changed files with 264 additions and 33 deletions

View File

@@ -9,21 +9,54 @@ GIT
GEM
remote: https://rubygems.org/
specs:
async (1.25.2)
console (~> 1.0)
nio4r (~> 2.3)
timers (~> 4.1)
async-http (0.52.0)
async (~> 1.25)
async-io (~> 1.28)
async-pool (~> 0.2)
protocol-http (~> 0.18.0)
protocol-http1 (~> 0.12.0)
protocol-http2 (~> 0.14.0)
async-io (1.29.0)
async (~> 1.14)
async-pool (0.3.0)
async (~> 1.25)
async-websocket (0.14.0)
async-http (~> 0.51)
async-io (~> 1.23)
protocol-websocket (~> 0.7.0)
console (1.8.2)
gosu (0.15.1)
gosu (0.15.1-x64-mingw32)
gosu_more_drawables (0.3.0)
mini_portile2 (2.5.0)
nio4r (2.5.2)
nokogiri (1.11.0.rc2)
mini_portile2 (~> 2.5.0)
nokogiri (1.11.0.rc2-x64-mingw32)
ocra (1.3.11)
opengl-bindings (1.6.10)
protocol-hpack (1.4.2)
protocol-http (0.18.0)
protocol-http1 (0.12.0)
protocol-http (~> 0.18)
protocol-http2 (0.14.0)
protocol-hpack (~> 1.4)
protocol-http (~> 0.18)
protocol-websocket (0.7.4)
protocol-http (~> 0.2)
protocol-http1 (~> 0.2)
timers (4.3.0)
PLATFORMS
ruby
x64-mingw32
DEPENDENCIES
async-websocket
cyberarm_engine!
nokogiri (>= 1.11.0.rc1)
ocra

View File

@@ -59,6 +59,8 @@ require_relative "lib/ui/menus/extras_menu"
require_relative "lib/ui/menus/level_select_menu"
require_relative "lib/ui/menus/game_pause_menu"
require_relative "lib/states/game_states/boot"
# require_relative "lib/states/game_states/close"
require_relative "lib/states/game_states/game"
require_relative "lib/states/game_states/loading_state"

View File

@@ -42,6 +42,46 @@ class IMICFPS
def fill(color = Gosu::Color::WHITE)
draw_rect(0, 0, window.width, window.height, color)
end
def fill_quad(x1, y1, x2, y2, x3, y3, x4, y4, color = Gosu::Color::WHITE, z = 0, mode = :default)
draw_quad(
x1,y1, color,
x2,y2, color,
x3,y3, color,
x4,y4, color,
z, mode
)
end
def menu_background(color, color_step, transparency, bar_size, slope)
((Gosu.screen_height + slope) / bar_size).times do |i|
fill_quad(
0, i * bar_size,
0, slope + (i * bar_size),
window.width / 2, (-slope) + (i * bar_size),
window.width / 2, i * bar_size,
Gosu::Color.rgba(
color.red - i * color_step,
color.green - i * color_step,
color.blue - i * color_step,
transparency
),
-2
)
fill_quad(
window.width, i * bar_size,
window.width, slope + (i * bar_size),
window.width / 2, (-slope) + (i * bar_size),
window.width / 2, i * bar_size,
Gosu::Color.rgba(
color.red - i * color_step,
color.green - i * color_step,
color.blue - i * color_step,
transparency
),
-2
)
end
end
def gl_error?
e = glGetError()

View File

@@ -0,0 +1,59 @@
class IMICFPS
class Boot < GameState
require_relative "../../../../gosu_more_drawables/lib/gosu_more_drawables/draw_circle"
def setup
@primary_color = Gosu::Color.rgba(255, 127, 0, 200)
@accent_color = Gosu::Color.rgba(155, 27, 0, 200)
@title = Text.new(IMICFPS::NAME, size: 100, z: 0, color: Gosu::Color.new(0xff000000), shadow: false, font: "Droid Serif")
@logo = get_image(IMICFPS::GAME_ROOT_PATH + "/static/logo.png")
@start_time = Gosu.milliseconds
@time_to_live = 3_000
end
def draw
menu_background(@primary_color, 10, 200, 50, 250)
fraction_left = ((Gosu.milliseconds - @start_time) / (@time_to_live - 250).to_f)
Gosu.draw_quad(
0, 0, @primary_color,
window.width, 0, @primary_color,
window.width, window.height, @accent_color,
0, window.height, @accent_color
)
if fraction_left <= 1.15
Gosu.draw_circle(
window.width / 2,
window.height / 2,
@logo.width / 2, 128, Gosu::Color.new(0x11ffffff)
)
Gosu.draw_arc(
window.width / 2,
window.height / 2,
@logo.width / 2, fraction_left.clamp(0.0, 1.0), 128, 8, Gosu::Color.new(0x33ff8800)
)
@logo.draw(window.width / 2 - @logo.width / 2, window.height / 2 - @logo.height / 2, 0)
@title.draw
end
end
def update
@title.x = window.width / 2 - @title.width / 2
@title.y = 0
push_state(MainMenu) if Gosu.milliseconds - @start_time >= @time_to_live
end
def button_up(id)
push_state(MainMenu)
end
end
end

View File

@@ -31,7 +31,7 @@ class IMICFPS
end
def draw
draw_background
menu_background(@base_color, @color_step, @background_alpha, @size, @slope)
draw_menu_box
draw_menu
@@ -46,27 +46,6 @@ class IMICFPS
end
end
def draw_background
((Gosu.screen_height+@slope)/@size).times do |i|
fill_quad(
0, i*@size,
0, @slope+(i*@size),
window.width/2, (-@slope)+(i*@size),
window.width/2, i*@size,
Gosu::Color.rgba(@base_color.red-i*@color_step, @base_color.green-i*@color_step, @base_color.blue-i*@color_step, @background_alpha),
-2
)
fill_quad(
window.width, i*@size,
window.width, @slope+(i*@size),
window.width/2, (-@slope)+(i*@size),
window.width/2, i*@size,
Gosu::Color.rgba(@base_color.red-i*@color_step, @base_color.green-i*@color_step, @base_color.blue-i*@color_step, @background_alpha),
-2
)
end
end
def draw_menu_box
draw_rect(
window.width/4, 0,
@@ -95,16 +74,6 @@ class IMICFPS
@__version_text.y = window.height - (@__version_text.height + 10)
end
def fill_quad(x1, y1, x2, y2, x3, y3, x4, y4, color = Gosu::Color::WHITE, z = 0, mode = :default)
draw_quad(
x1,y1, color,
x2,y2, color,
x3,y3, color,
x4,y4, color,
z, mode
)
end
def button_up(id)
if id == Gosu::MsLeft
@elements.each do |e|

View File

@@ -34,7 +34,7 @@ class IMICFPS
@config.save!
end
push_state(MainMenu)
push_state(Boot)
@delta_time = Gosu.milliseconds
end

BIN
static/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

128
svg/logo.svg Normal file
View File

@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="232"
height="232"
viewBox="0 0 61.383334 61.383334"
version="1.1"
id="svg8"
sodipodi:docname="logo.svg"
inkscape:export-filename="/home/cyberarm/Code/i-mic-fps/static/logo.png"
inkscape:export-xdpi="211.86208"
inkscape:export-ydpi="211.86208"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4142136"
inkscape:cx="28.822764"
inkscape:cy="101.19387"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
units="px"
borderlayer="true"
inkscape:showpageshadow="false"
inkscape:snap-bbox="true"
inkscape:snap-intersection-paths="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="1010"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid10"
empspacing="8"
originx="0"
originy="2.2411203e-09"
dotted="false" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-33.940008,-296.21455)">
<path
style="opacity:1;fill:#e9b96e;fill-opacity:1;stroke:#000000;stroke-width:0.52916664;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
d="m 69.448977,318.17079 h -9.524999 l 4.7625,4.7625 z"
id="path42"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill:#8f5902;fill-opacity:1;stroke:#000000;stroke-width:0.52916664;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
d="m 51.986478,310.23329 7.9375,7.9375 h 9.524999 l 7.9375,-7.9375 z"
id="path30"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill:#ce5c00;fill-opacity:1;stroke:#000000;stroke-width:0.52916664;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
d="m 69.448977,318.17079 16.485815,16.48581 7.9375,-7.9375 -16.485815,-16.48581 z"
id="path47"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill:#ce5c00;fill-opacity:1;stroke:#000000;stroke-width:0.52916664;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
d="m 64.686478,322.93329 v 32.97163 L 85.934792,334.6566 69.448977,318.17079 Z"
id="path50"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill:#f57900;fill-opacity:1;stroke:#000000;stroke-width:0.52916664;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
d="M 59.923978,318.17079 43.438163,334.6566 64.686478,355.90492 V 322.93329 Z"
id="path45"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill:#f57900;fill-opacity:1;stroke:#000000;stroke-width:0.52916664;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
d="m 51.986478,310.23329 -16.485815,16.48581 7.9375,7.9375 16.485815,-16.48581 z"
id="path28"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill:#f57900;fill-opacity:1;stroke:#000000;stroke-width:0.52916664;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
d="m 64.686478,297.53329 -12.7,12.7 h 12.7 z"
id="path53"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill:#ce5c00;fill-opacity:1;stroke:#000000;stroke-width:0.52916664;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
d="m 64.686478,297.53329 v 12.7 h 12.699999 z"
id="rect22"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:1.25;font-family:'Droid Serif';-inkscape-font-specification:'Droid Serif';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="99.88446"
y="329.00253"
id="text14"><tspan
sodipodi:role="line"
id="tspan12"
x="99.88446"
y="329.00253"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Droid Serif';-inkscape-font-specification:'Droid Serif';fill:#000000;stroke-width:0.26458332">I-MIC FPS</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.0 KiB