Fixed winning screen, collisions
This commit is contained in:
1 parent
a288d9f1a1
commit
e714ead17f
10 files changed
+1028
-112
No files matched your search
@@ -1 +1 @@
|
||||
{"meta":{"format_version":"4.10","model_format":"free","box_uv":false},"name":"background","model_identifier":"","visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"timeline_setups":[],"unhandled_root_fields":{},"resolution":{"width":16,"height":16},"elements":[{"name":"plane","color":3,"origin":[0,0,0],"rotation":[0,0,0],"export":true,"visibility":true,"locked":false,"render_order":"default","allow_mirror_modeling":true,"vertices":{"vqd0":[8,5,8],"sszo":[8,0,-9.000000000000004],"puxc":[-8,5,8],"4RLd":[-8,0,-9.000000000000004],"XhyS":[8,2.3333387633540412,2.666684042732932],"5zpr":[-8,2.3333387633540412,2.666684042732932],"pp64":[8,0.6666748117065739,-2.666640602538963],"vwIL":[-8,0.6666748117065739,-2.666640602538963],"HWac":[8,-8.124035629837435,-12.992277764807229],"gOq5":[-8,-8.124035629837435,-12.992277764807229]},"faces":{"7V9fAqsd":{"uv":{"4RLd":[0,1.125],"pp64":[16,5.333359397461037],"vwIL":[0,5.333359397461037],"sszo":[16,1.125]},"vertices":["4RLd","pp64","vwIL","sszo"],"texture":0},"LZcwHZcF":{"uv":{"vqd0":[16,16],"XhyS":[16,10.666684042732932],"5zpr":[0,10.666684042732932],"puxc":[0,16]},"vertices":["vqd0","XhyS","5zpr","puxc"],"texture":0},"Aqhlu0jG":{"uv":{"XhyS":[16,10.666684042732932],"pp64":[16,5.333359397461037],"vwIL":[0,5.333359397461037],"5zpr":[0,10.666684042732932]},"vertices":["XhyS","pp64","vwIL","5zpr"],"texture":0},"iZSsukM9":{"uv":{"HWac":[0,1],"gOq5":[16,1],"sszo":[0,0],"4RLd":[16,0]},"vertices":["HWac","gOq5","sszo","4RLd"],"texture":0}},"type":"mesh","uuid":"e663511f-7947-9bcf-3696-da6ccdb6351c"},{"name":"plane","color":3,"origin":[-16,0,0],"rotation":[0,0,0],"export":true,"visibility":true,"locked":false,"render_order":"default","allow_mirror_modeling":true,"vertices":{"vqd0":[8,5,8],"sszo":[8,0,-9],"puxc":[-8,5,8],"4RLd":[-8,0,-9],"XhyS":[8,2.3333387633540412,2.666684042732932],"5zpr":[-8,2.3333387633540412,2.666684042732932],"pp64":[8,0.6666748117065739,-2.666640602538963],"vwIL":[-8,0.6666748117065739,-2.666640602538963],"HWac":[8,-8.124035629837435,-12.992277764807229],"gOq5":[-8,-8.124035629837435,-12.992277764807229]},"faces":{"7V9fAqsd":{"uv":{"4RLd":[0,1.125],"pp64":[16,5.333359397461037],"vwIL":[0,5.333359397461037],"sszo":[16,1.125]},"vertices":["4RLd","pp64","vwIL","sszo"],"texture":0},"LZcwHZcF":{"uv":{"vqd0":[16,16],"XhyS":[16,10.666684042732932],"5zpr":[0,10.666684042732932],"puxc":[0,16]},"vertices":["vqd0","XhyS","5zpr","puxc"],"texture":0},"Aqhlu0jG":{"uv":{"XhyS":[16,10.666684042732932],"pp64":[16,5.333359397461037],"vwIL":[0,5.333359397461037],"5zpr":[0,10.666684042732932]},"vertices":["XhyS","pp64","vwIL","5zpr"],"texture":0},"iZSsukM9":{"uv":{"HWac":[0,1],"gOq5":[16,1],"sszo":[0,0],"4RLd":[16,0]},"vertices":["HWac","gOq5","sszo","4RLd"],"texture":0}},"type":"mesh","uuid":"31f9187e-b7a5-8d0c-cae8-f04611625d83"},{"name":"plane","color":3,"origin":[16,0,0],"rotation":[0,0,0],"export":true,"visibility":true,"locked":false,"render_order":"default","allow_mirror_modeling":true,"vertices":{"vqd0":[8,5,8],"sszo":[8,0,-9],"puxc":[-8,5,8],"4RLd":[-8,0,-9],"XhyS":[8,2.3333387633540412,2.666684042732932],"5zpr":[-8,2.3333387633540412,2.666684042732932],"pp64":[8,0.6666748117065739,-2.666640602538963],"vwIL":[-8,0.6666748117065739,-2.666640602538963],"HWac":[8,-8.124035629837435,-12.992277764807229],"gOq5":[-8,-8.124035629837435,-12.992277764807229]},"faces":{"7V9fAqsd":{"uv":{"4RLd":[0,1.125],"pp64":[16,5.333359397461037],"vwIL":[0,5.333359397461037],"sszo":[16,1.125]},"vertices":["4RLd","pp64","vwIL","sszo"],"texture":0},"LZcwHZcF":{"uv":{"vqd0":[16,16],"XhyS":[16,10.666684042732932],"5zpr":[0,10.666684042732932],"puxc":[0,16]},"vertices":["vqd0","XhyS","5zpr","puxc"],"texture":0},"Aqhlu0jG":{"uv":{"XhyS":[16,10.666684042732932],"pp64":[16,5.333359397461037],"vwIL":[0,5.333359397461037],"5zpr":[0,10.666684042732932]},"vertices":["XhyS","pp64","vwIL","5zpr"],"texture":0},"iZSsukM9":{"uv":{"HWac":[0,1],"gOq5":[16,1],"sszo":[0,0],"4RLd":[16,0]},"vertices":["HWac","gOq5","sszo","4RLd"],"texture":0}},"type":"mesh","uuid":"eed92c19-a9c4-1afa-2731-bfe15cc13ece"}],"outliner":["e663511f-7947-9bcf-3696-da6ccdb6351c","31f9187e-b7a5-8d0c-cae8-f04611625d83","eed92c19-a9c4-1afa-2731-bfe15cc13ece"],"textures":[{"path":"C:\\Dev\\sineus-final\\assets\\models\\background.png","name":"background.png","folder":"block","namespace":"","id":"0","group":"","width":128,"height":128,"uv_width":16,"uv_height":16,"particle":false,"use_as_default":false,"layers_enabled":false,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"3faa339c-1a1f-acb0-d167-578e9ad5cc6b","relative_path":"background.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAA/ZJREFUeF7tnMGNE0EUBdcRcObC2RIRIHHkSiBkwJEDmWwE5EAKBEIEoLVkybJsb/dUt73vd3GeN/3/q/LsrJF29+Hr/t+T/5ZtYKcAy7I/LK4Aa/NXgMX5K4AC+BLine truncated
|
||||
{"meta":{"format_version":"4.10","model_format":"free","box_uv":false},"name":"background","model_identifier":"","visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"timeline_setups":[],"unhandled_root_fields":{},"resolution":{"width":64,"height":64},"elements":[{"name":"cuboid","color":6,"origin":[3,0,0.6],"rotation":[0,0,0],"export":true,"visibility":true,"locked":false,"render_order":"default","allow_mirror_modeling":true,"vertices":{"YCVL":[-2.4,13.444444444444445,7],"YAil":[-2.4,13.444444444444445,5],"gtVo":[-2.4,1,7],"fp5R":[-2.4,1,5],"9IEP":[-4.6,13.444444444444445,7],"Nz91":[-4.6,13.444444444444445,5],"OwN3":[-4.6,1,7],"0SLO":[-4.6,1,5],"tJtG":[-2.9499999999999997,13.444444444444445,6.5],"hGmZ":[-2.9499999999999997,13.444444444444445,5.5],"DBt8":[-4.05,13.444444444444445,6.5],"vHDd":[-4.05,13.444444444444445,5.5],"4W5Q":[-2.9499999999999997,15.222222222222221,6.5],"Xp2M":[-2.9499999999999997,15.222222222222221,5.5],"28fP":[-4.05,15.222222222222221,6.5],"d6Uv":[-4.05,15.222222222222221,5.5],"jvy6":[-3.2249999999999996,15.222222222222221,6.25],"Z2oF":[-3.2249999999999996,15.222222222222221,5.75],"1QEi":[-3.775,15.222222222222221,6.25],"Qd9a":[-3.775,15.222222222222221,5.75],"RiXH":[-3.2249999999999996,17,6.25],"px8s":[-3.2249999999999996,17,5.75],"lngp":[-3.775,17,6.25],"IdNx":[-3.775,17,5.75]},"faces":{"HqfGHypA":{"uv":{"YCVL":[17,10],"gtVo":[17,24],"YAil":[19,10],"fp5R":[19,24]},"vertices":["YCVL","gtVo","YAil","fp5R"],"texture":0},"Y5SrQ8v4":{"uv":{"9IEP":[2,19],"Nz91":[0,19],"OwN3":[2,33],"0SLO":[0,33]},"vertices":["9IEP","Nz91","OwN3","0SLO"],"texture":0},"vCqdPhaQ":{"uv":{"RiXH":[3,52],"px8s":[3,51],"lngp":[2,52],"IdNx":[2,51]},"vertices":["RiXH","px8s","lngp","IdNx"],"texture":0},"xWyZe7nq":{"uv":{"gtVo":[50,33],"OwN3":[48,33],"fp5R":[50,35],"0SLO":[48,35]},"vertices":["gtVo","OwN3","fp5R","0SLO"],"texture":0},"WILAyMwT":{"uv":{"YCVL":[5,19],"9IEP":[3,19],"gtVo":[5,33],"OwN3":[3,33]},"vertices":["YCVL","9IEP","gtVo","OwN3"],"texture":0},"aS1flRXl":{"uv":{"YAil":[6,19],"fp5R":[6,33],"Nz91":[8,19],"0SLO":[8,33]},"vertices":["YAil","fp5R","Nz91","0SLO"],"texture":0},"sTAEy81a":{"uv":{"tJtG":[49.675,31.5],"DBt8":[48.575,31.5],"9IEP":[48.025,32],"YCVL":[50.225,32]},"vertices":["tJtG","DBt8","9IEP","YCVL"],"texture":0},"GKwhemH8":{"uv":{"tJtG":[49.675,31.5],"hGmZ":[49.675,30.5],"YCVL":[50.225,32],"YAil":[50.225,30]},"vertices":["hGmZ","tJtG","YCVL","YAil"],"texture":0},"KrwxJB8y":{"uv":{"hGmZ":[49.675,30.5],"vHDd":[48.575,30.5],"YAil":[50.225,30],"Nz91":[48.025,30]},"vertices":["vHDd","hGmZ","YAil","Nz91"],"texture":0},"AQlGDgSA":{"uv":{"DBt8":[48.575,31.5],"vHDd":[48.575,30.5],"Nz91":[48.025,30],"9IEP":[48.025,32]},"vertices":["DBt8","vHDd","Nz91","9IEP"],"texture":0},"1L4vtiPA":{"uv":{"4W5Q":[16,19],"28fP":[15,19],"DBt8":[15,21],"tJtG":[16,21]},"vertices":["4W5Q","28fP","DBt8","tJtG"],"texture":0},"YsgaTK9i":{"uv":{"4W5Q":[15,22],"Xp2M":[16,22],"tJtG":[15,24],"hGmZ":[16,24]},"vertices":["Xp2M","4W5Q","tJtG","hGmZ"],"texture":0},"SqVMcDpm":{"uv":{"Xp2M":[48,36],"d6Uv":[49,36],"hGmZ":[48,38],"vHDd":[49,38]},"vertices":["d6Uv","Xp2M","hGmZ","vHDd"],"texture":0},"jCL4diXt":{"uv":{"28fP":[49,39],"d6Uv":[48,39],"vHDd":[48,41],"DBt8":[49,41]},"vertices":["28fP","d6Uv","vHDd","DBt8"],"texture":0},"fGdRAj6n":{"uv":{"jvy6":[50.8375,50.75],"1QEi":[50.2875,50.75],"28fP":[50.0125,51],"4W5Q":[51.1125,51]},"vertices":["jvy6","1QEi","28fP","4W5Q"],"texture":0},"fAQxbNYr":{"uv":{"jvy6":[50.8375,50.75],"Z2oF":[50.8375,50.25],"4W5Q":[51.1125,51],"Xp2M":[51.1125,50]},"vertices":["Z2oF","jvy6","4W5Q","Xp2M"],"texture":0},"qyWSEB6t":{"uv":{"Z2oF":[50.8375,50.25],"Qd9a":[50.2875,50.25],"Xp2M":[51.1125,50],"d6Uv":[50.0125,50]},"vertices":["Qd9a","Z2oF","Xp2M","d6Uv"],"texture":0},"RTtVmO96":{"uv":{"1QEi":[50.2875,50.75],"Qd9a":[50.2875,50.25],"d6Uv":[50.0125,50],"28fP":[50.0125,51]},"vertices":["1QEi","Qd9a","d6Uv","28fP"],"texture":0},"fwZhw6HU":{"uv":{"RiXH":[49,42],"lngp":[48,42],"1QEi":[48,44],"jvy6":[49,44]},"vertices":["RiXH","lngp","1QEi","jvy6"],"texture":0},"L2pKUxHt":{"uv":{"RiXH":[48,45],"px8s":[49,45],"jvy6":[48,47],"Z2oF":[49,47]},"vertices":["px8s","RiXH","jvy6","Z2oF"],"texture":0},"IYyOyvPG":{"uv":{"px8s":[48,48],"IdNx":[49,48],"Z2oF":[48,50],"Qd9a":[49,50]},"vertices":["IdNx","px8s","Z2oF","Qd9a"],"texture":0},"2Zn7vevP":{"uv":{"lngp":[1,49],"IdNx":[0,49],"Qd9a":[0,51],"1QEi":[1,51]},"vertices":["lngp","IdNx","Qd9a","1QEi"],"texture":0}},"type":"mesh","uuid":"4290fd02-9df7-7bc9-073a-667fc9e5ccfb"},{"name":"cuboid","color":6,"origin":[3,-3.000000000000001,-0.9999999999999997],"rotation":[0,0,0],"export":true,"visibility":true,"locked":false,"render_order":"default","allow_mirror_modeling":true,"vertices":{"YCVL":[-2.7,13,6.7],"YAil":[-2.7,13,5.3],"gtVo":[-2.7,1,6.7],"fp5R":[-2.7,1,5.3],"9IEP":[-4.3,13,6.7],"Nz91":[-4.3,13,5.3],"OwN3":[-4.3,1,6.7],"0SLO":[-4.3,1,5.3]},"faces":{"HqfGHypA":{"uv":{"YCVL":[18,40],"gtVo":[18,54],"YAil":[19,40],"fp5R":[19,54]},"vertices":["YCVL","gLine truncated
|
||||
@@ -1,4 +1,4 @@
|
||||
# Made in Blockbench 4.11.1
|
||||
newmtl m_3faa339c-1a1f-acb0-d167-578e9ad5cc6b
|
||||
newmtl m_a4450cf3-b34d-625a-0f2a-2e3eff98962f
|
||||
map_Kd background.png
|
||||
newmtl none
|
||||
+1009
-91
File diff suppressed because it is too large.
Load diff
Binary file not shown.
|
Before Width: | Height: | Size: 661 B After Width: | Height: | Size: 11 KiB |
@@ -44,7 +44,6 @@ explosions_process :: proc(delta: f32) {
|
||||
explosions_draw :: proc() {
|
||||
rl.BeginBlendMode(rl.BlendMode.ADDITIVE)
|
||||
#reverse for &e, i in explosions {
|
||||
fmt.println(e.time)
|
||||
color := rl.ColorAlpha(e.color, 1 - ease.exponential_in(e.time / e.duration))
|
||||
rl.DrawSphere(e.position, e.radius, color)
|
||||
}
|
||||
|
||||
+3
-7
@@ -62,18 +62,14 @@ gameover_draw :: proc(state: ^GameState) {
|
||||
|
||||
SubtitleText := [?]cstring{"Нажмите Escape чтобы выйти"}
|
||||
SubtitleFontSize :: 48
|
||||
SubtitleSpacing :: 2
|
||||
SubtitleSizes := [?]vec2{{}}
|
||||
for c, i in SubtitleText {
|
||||
SubtitleSizes = rl.MeasureTextEx(Res.Fonts.UI, c, SubtitleFontSize, SubtitleSpacing)
|
||||
}
|
||||
|
||||
|
||||
rl.DrawRectangleV(gameover.position - gameover.size / 2, gameover.size, rl.Color{90, 30, 150, 10})
|
||||
|
||||
rl.DrawTextPro(Res.Fonts.Title, TitleText, gameover.position - {0, 100}, TitleSize / 2, 0, TitleFontSize, TitleSpacing, rl.WHITE)
|
||||
draw_text_centered(Res.Fonts.Title, TitleText, gameover.position - {0, 100}, TitleFontSize, 1, rl.WHITE)
|
||||
for c, i in SubtitleText {
|
||||
rl.DrawTextPro(Res.Fonts.UI, c, gameover.position - {0, f32(10 - i * 50)}, SubtitleSizes[i] / 2, 0, SubtitleFontSize, SubtitleSpacing, rl.WHITE)
|
||||
draw_text_centered(Res.Fonts.UI, c, gameover.position - {0, f32(10 - i * 50)}, SubtitleFontSize, 1, rl.WHITE)
|
||||
// rl.DrawTextPro(Res.Fonts.UI, c, winning.position - {0, f32(10 - i * 50)}, SubtitleSizes[i] / 2, 0, SubtitleFontSize, SubtitleSpacing, rl.WHITE)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -75,6 +75,10 @@ player_update :: proc(player: ^Player, game: ^Game, delta: f32) {
|
||||
|
||||
if !is_dead {
|
||||
pos += vel * delta
|
||||
if pos.y < radius {
|
||||
pos.y = radius
|
||||
vel.y = - vel.y
|
||||
}
|
||||
if !is_dodging {
|
||||
dir_vector : vec3
|
||||
if intro_timer <= 0 {
|
||||
|
||||
@@ -244,6 +244,10 @@ snake_hunt :: proc(game: ^Game, delta: f32) {
|
||||
Head.vel = rl.Vector3MoveTowards(Head.vel, rl.Vector3Normalize(target_diff) * 50, 40 * delta)
|
||||
Head.dir = math.atan2(-Head.vel.y, Head.vel.x)
|
||||
Head.pos += Head.vel * delta
|
||||
if Head.pos.y < Head.radius {
|
||||
Head.pos.y = Head.radius
|
||||
Head.vel.y = -Head.vel.y / 2
|
||||
}
|
||||
}
|
||||
|
||||
snake_shot :: proc(game: ^Game, delta: f32) {
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ get_vec_from_angle :: proc(angle: f32) -> vec3 {
|
||||
return rl.Vector3RotateByAxisAngle(vec3right, vec3backward, angle)
|
||||
}
|
||||
|
||||
draw_text_centered :: proc(font: rl.Font, text: cstring, pos: vec2, size: f32) {
|
||||
draw_text_centered :: proc(font: rl.Font, text: cstring, pos: vec2, size: f32, spacing : f32 = 1, color : rl.Color = rl.BLACK) {
|
||||
text_size := rl.MeasureTextEx(font, text, size, 1)
|
||||
rl.DrawTextPro(font, text, pos, text_size / 2, 0, size, 1, rl.BLACK)
|
||||
rl.DrawTextPro(font, text, pos, text_size / 2, 0, size, 1, color)
|
||||
}
|
||||
+4
-9
@@ -58,22 +58,17 @@ winning_draw :: proc(state: ^GameState) {
|
||||
TitleFontSize :: 96
|
||||
TitleSpacing :: 3
|
||||
TitleText :: "GAME OVER"
|
||||
TitleSize := rl.MeasureTextEx(Res.Fonts.Title, TitleText, TitleFontSize, TitleSpacing)
|
||||
|
||||
SubtitleText := [?]cstring{"Тор смог спасти Асгард от Рагнарёка", "Нажмите Escape чтобы выйти"}
|
||||
SubtitleText := [?]cstring{"Тор смог спасти Асгард", "от Рагнарёка!", "Нажмите Escape чтобы выйти"}
|
||||
SubtitleFontSize :: 48
|
||||
SubtitleSpacing :: 2
|
||||
SubtitleSizes := [?]vec2{{}, {}}
|
||||
for c, i in SubtitleText {
|
||||
SubtitleSizes = rl.MeasureTextEx(Res.Fonts.UI, c, SubtitleFontSize, SubtitleSpacing)
|
||||
}
|
||||
|
||||
|
||||
rl.DrawRectangleV(winning.position - winning.size / 2, winning.size, rl.Color{90, 30, 150, 10})
|
||||
|
||||
rl.DrawTextPro(Res.Fonts.Title, TitleText, winning.position - {0, 100}, TitleSize / 2, 0, TitleFontSize, TitleSpacing, rl.WHITE)
|
||||
draw_text_centered(Res.Fonts.Title, TitleText, winning.position - {0, 100}, TitleFontSize, 1, rl.WHITE)
|
||||
for c, i in SubtitleText {
|
||||
rl.DrawTextPro(Res.Fonts.UI, c, winning.position - {0, f32(10 - i * 50)}, SubtitleSizes[i] / 2, 0, SubtitleFontSize, SubtitleSpacing, rl.WHITE)
|
||||
draw_text_centered(Res.Fonts.UI, c, winning.position - {0, f32(10 - i * 50)}, SubtitleFontSize, 1, rl.WHITE)
|
||||
// rl.DrawTextPro(Res.Fonts.UI, c, winning.position - {0, f32(10 - i * 50)}, SubtitleSizes[i] / 2, 0, SubtitleFontSize, SubtitleSpacing, rl.WHITE)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user