Merge remote-tracking branch 'origin/LevelSystemAndSuch' into water
@@ -0,0 +1,12 @@
|
||||
# Blender MTL File: 'Bricks.blend'
|
||||
# Material Count: 1
|
||||
|
||||
newmtl Material.004
|
||||
Ns 96.078431
|
||||
Ka 0.000000 0.000000 0.000000
|
||||
Kd 0.640000 0.640000 0.640000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd InkBrickTexture.png
|
||||
@@ -0,0 +1,513 @@
|
||||
# Blender v2.75 (sub 0) OBJ File: 'Bricks.blend'
|
||||
# www.blender.org
|
||||
mtllib InkBrick.mtl
|
||||
o OriginalBrick.015_Cube.028
|
||||
v 0.416882 0.151013 0.189181
|
||||
v 0.383459 0.157800 0.197587
|
||||
v 0.427922 0.161606 0.161784
|
||||
v 0.383459 0.180000 0.161784
|
||||
v 0.432779 0.125616 0.202365
|
||||
v 0.383459 0.126000 0.215784
|
||||
v 0.450000 0.126000 0.161784
|
||||
v -0.416882 0.151013 0.189181
|
||||
v 0.000000 0.157800 0.197587
|
||||
v -0.383459 0.157800 0.197587
|
||||
v -0.427922 0.161606 0.161784
|
||||
v 0.000000 0.180000 0.161784
|
||||
v -0.383459 0.180000 0.161784
|
||||
v -0.432779 0.125616 0.202365
|
||||
v 0.000000 0.126000 0.215784
|
||||
v -0.383459 0.126000 0.215784
|
||||
v -0.450000 0.126000 0.161784
|
||||
v 0.427922 0.161606 0.000000
|
||||
v 0.416882 0.151013 -0.189181
|
||||
v 0.383459 0.180000 0.000000
|
||||
v 0.383459 0.157800 -0.197587
|
||||
v 0.427922 0.161606 -0.161784
|
||||
v 0.383459 0.180000 -0.161784
|
||||
v 0.450000 0.126000 0.000000
|
||||
v 0.432779 0.125616 -0.202365
|
||||
v 0.383459 0.126000 -0.215784
|
||||
v 0.450000 0.126000 -0.161784
|
||||
v 0.000000 0.180000 0.000000
|
||||
v -0.427922 0.161606 0.000000
|
||||
v -0.416882 0.151013 -0.189181
|
||||
v 0.000000 0.157800 -0.197587
|
||||
v -0.383459 0.180000 0.000000
|
||||
v -0.383459 0.157800 -0.197587
|
||||
v -0.427922 0.161606 -0.161784
|
||||
v 0.000000 0.180000 -0.161784
|
||||
v -0.383459 0.180000 -0.161784
|
||||
v -0.450000 0.126000 0.000000
|
||||
v -0.432779 0.125616 -0.202365
|
||||
v 0.000000 0.126000 -0.215784
|
||||
v -0.383459 0.126000 -0.215784
|
||||
v -0.450000 0.126000 -0.161784
|
||||
v 0.416882 -0.151013 0.189181
|
||||
v 0.383459 -0.157800 0.197587
|
||||
v 0.427922 -0.161606 0.161784
|
||||
v 0.383459 -0.180000 0.161784
|
||||
v 0.432779 -0.125616 0.202365
|
||||
v 0.383459 -0.126000 0.215784
|
||||
v 0.450000 -0.126000 0.161784
|
||||
v 0.432723 0.000000 0.202132
|
||||
v 0.383459 0.000000 0.215784
|
||||
v 0.450000 0.000000 0.161784
|
||||
v -0.416882 -0.151013 0.189181
|
||||
v 0.000000 -0.157800 0.197587
|
||||
v -0.383459 -0.157800 0.197587
|
||||
v -0.427922 -0.161606 0.161784
|
||||
v 0.000000 -0.180000 0.161784
|
||||
v -0.383459 -0.180000 0.161784
|
||||
v -0.432779 -0.125616 0.202365
|
||||
v 0.000000 -0.126000 0.215784
|
||||
v -0.383459 -0.126000 0.215784
|
||||
v -0.450000 -0.126000 0.161784
|
||||
v -0.432723 0.000000 0.202132
|
||||
v 0.000000 0.000000 0.215784
|
||||
v -0.383459 0.000000 0.215784
|
||||
v -0.450000 0.000000 0.161784
|
||||
v 0.427922 -0.161606 0.000000
|
||||
v 0.416882 -0.151013 -0.189181
|
||||
v 0.383459 -0.180000 0.000000
|
||||
v 0.383459 -0.157800 -0.197587
|
||||
v 0.427922 -0.161606 -0.161784
|
||||
v 0.383459 -0.180000 -0.161784
|
||||
v 0.450000 -0.126000 0.000000
|
||||
v 0.432779 -0.125616 -0.202365
|
||||
v 0.383459 -0.126000 -0.215784
|
||||
v 0.450000 -0.126000 -0.161784
|
||||
v 0.450000 0.000000 0.000000
|
||||
v 0.432723 0.000000 -0.202132
|
||||
v 0.383459 0.000000 -0.215784
|
||||
v 0.450000 0.000000 -0.161784
|
||||
v 0.000000 -0.180000 0.000000
|
||||
v -0.427922 -0.161606 0.000000
|
||||
v -0.416882 -0.151013 -0.189181
|
||||
v 0.000000 -0.157800 -0.197587
|
||||
v -0.383459 -0.180000 0.000000
|
||||
v -0.383459 -0.157800 -0.197587
|
||||
v -0.427922 -0.161606 -0.161784
|
||||
v 0.000000 -0.180000 -0.161784
|
||||
v -0.383459 -0.180000 -0.161784
|
||||
v -0.450000 -0.126000 0.000000
|
||||
v -0.432779 -0.125616 -0.202365
|
||||
v 0.000000 -0.126000 -0.215784
|
||||
v -0.383459 -0.126000 -0.215784
|
||||
v -0.450000 -0.126000 -0.161784
|
||||
v -0.450000 0.000000 0.000000
|
||||
v -0.432723 0.000000 -0.202132
|
||||
v 0.000000 0.000000 -0.215784
|
||||
v -0.383459 0.000000 -0.215784
|
||||
v -0.450000 0.000000 -0.161784
|
||||
vt 0.736296 0.734058
|
||||
vt 0.500643 0.743520
|
||||
vt 0.500362 0.637947
|
||||
vt 0.837408 0.612007
|
||||
vt 0.834584 0.645864
|
||||
vt 0.730556 0.620368
|
||||
vt 0.734629 0.582637
|
||||
vt 0.749262 0.590630
|
||||
vt 0.500288 0.610193
|
||||
vt 0.755018 0.568012
|
||||
vt 0.839541 0.583855
|
||||
vt 0.717484 0.591376
|
||||
vt 0.712524 0.570102
|
||||
vt 0.500224 0.586196
|
||||
vt 0.735447 0.565260
|
||||
vt 0.734762 0.501989
|
||||
vt 0.756709 0.501913
|
||||
vt 0.500002 0.502775
|
||||
vt 0.708830 0.502077
|
||||
vt 0.842604 0.501613
|
||||
vt 0.264945 0.735621
|
||||
vt 0.270081 0.621896
|
||||
vt 0.166203 0.648090
|
||||
vt 0.163195 0.614255
|
||||
vt 0.265807 0.584195
|
||||
vt 0.282998 0.592819
|
||||
vt 0.160910 0.586119
|
||||
vt 0.245341 0.569708
|
||||
vt 0.251218 0.592286
|
||||
vt 0.264896 0.566824
|
||||
vt 0.287844 0.571513
|
||||
vt 0.243294 0.503622
|
||||
vt 0.265242 0.503551
|
||||
vt 0.291174 0.503466
|
||||
vt 0.157399 0.503902
|
||||
vt 0.500934 0.853308
|
||||
vt 0.941713 0.642142
|
||||
vt 0.951578 0.604167
|
||||
vt 0.968122 0.623010
|
||||
vt 0.501012 0.882459
|
||||
vt 0.738745 0.848046
|
||||
vt 0.931097 0.581575
|
||||
vt 0.932938 0.607778
|
||||
vt 0.955207 0.583085
|
||||
vt 0.985107 0.598851
|
||||
vt 0.739681 0.902895
|
||||
vt 0.501079 0.907860
|
||||
vt 0.935388 0.501282
|
||||
vt 0.963040 0.501182
|
||||
vt 0.741078 0.990924
|
||||
vt 0.501311 0.995378
|
||||
vt 0.999949 0.501047
|
||||
vt 0.059065 0.645100
|
||||
vt 0.048991 0.607196
|
||||
vt 0.067650 0.610678
|
||||
vt 0.263101 0.849623
|
||||
vt 0.069348 0.584464
|
||||
vt 0.032552 0.626152
|
||||
vt 0.015434 0.602112
|
||||
vt 0.262456 0.904477
|
||||
vt 0.045246 0.586140
|
||||
vt 0.036960 0.504291
|
||||
vt 0.064611 0.504202
|
||||
vt 0.261526 0.992513
|
||||
vt 0.000049 0.504410
|
||||
vt 0.499642 0.367606
|
||||
vt 0.499361 0.262038
|
||||
vt 0.735045 0.269934
|
||||
vt 0.729910 0.383652
|
||||
vt 0.833769 0.357438
|
||||
vt 0.836784 0.391268
|
||||
vt 0.734188 0.421348
|
||||
vt 0.716998 0.412727
|
||||
vt 0.499716 0.395359
|
||||
vt 0.839075 0.419400
|
||||
vt 0.754653 0.435831
|
||||
vt 0.748775 0.413256
|
||||
vt 0.735100 0.438717
|
||||
vt 0.712155 0.434032
|
||||
vt 0.499780 0.419355
|
||||
vt 0.263722 0.271498
|
||||
vt 0.162621 0.393515
|
||||
vt 0.165454 0.359662
|
||||
vt 0.269461 0.385180
|
||||
vt 0.265384 0.422906
|
||||
vt 0.250754 0.414912
|
||||
vt 0.244996 0.437526
|
||||
vt 0.160482 0.421664
|
||||
vt 0.282529 0.414171
|
||||
vt 0.287486 0.435443
|
||||
vt 0.264565 0.440282
|
||||
vt 0.499070 0.152257
|
||||
vt 0.940896 0.360393
|
||||
vt 0.950979 0.398289
|
||||
vt 0.932321 0.394814
|
||||
vt 0.736888 0.155940
|
||||
vt 0.498993 0.123107
|
||||
vt 0.930630 0.421027
|
||||
vt 0.967411 0.379329
|
||||
vt 0.984535 0.403359
|
||||
vt 0.498925 0.097707
|
||||
vt 0.737533 0.101089
|
||||
vt 0.954730 0.419342
|
||||
vt 0.498693 0.010195
|
||||
vt 0.738463 0.013059
|
||||
vt 0.058336 0.363344
|
||||
vt 0.048459 0.401312
|
||||
vt 0.031922 0.382463
|
||||
vt 0.261274 0.157517
|
||||
vt 0.068933 0.423912
|
||||
vt 0.067099 0.397709
|
||||
vt 0.044823 0.422391
|
||||
vt 0.014928 0.406612
|
||||
vt 0.260338 0.102671
|
||||
vt 0.258941 0.014648
|
||||
vt 0.739249 0.877387
|
||||
vt 0.262753 0.878967
|
||||
vt 0.737237 0.126597
|
||||
vt 0.260770 0.128177
|
||||
vn 0.194900 0.980800 0.000000
|
||||
vn 0.000000 1.000000 0.000000
|
||||
vn 0.000000 0.961700 0.273900
|
||||
vn 0.647300 0.762200 0.000000
|
||||
vn 0.178700 0.949500 0.257800
|
||||
vn 0.457300 0.661600 0.594300
|
||||
vn 0.631200 0.737600 0.239800
|
||||
vn 0.000000 0.694500 0.719500
|
||||
vn 0.939500 0.276000 0.202600
|
||||
vn 0.961700 0.274000 0.000000
|
||||
vn 0.151600 0.685100 0.712500
|
||||
vn 0.135500 0.258500 0.956400
|
||||
vn 0.000000 0.256900 0.966400
|
||||
vn 0.632300 0.305000 0.712100
|
||||
vn 0.658300 0.000000 0.752800
|
||||
vn 0.979700 0.000000 0.200600
|
||||
vn 0.000000 0.000000 1.000000
|
||||
vn 0.134200 0.000000 0.990900
|
||||
vn 1.000000 0.000000 0.000000
|
||||
vn -0.194900 0.980800 0.000000
|
||||
vn -0.178700 0.949500 0.257800
|
||||
vn -0.647300 0.762200 0.000000
|
||||
vn -0.457300 0.661600 0.594300
|
||||
vn -0.151600 0.685100 0.712500
|
||||
vn -0.961700 0.274000 0.000000
|
||||
vn -0.939500 0.276000 0.202600
|
||||
vn -0.631200 0.737600 0.239800
|
||||
vn -0.632300 0.305000 0.712100
|
||||
vn -0.135500 0.258500 0.956400
|
||||
vn -0.979700 0.000000 0.200600
|
||||
vn -0.658300 0.000000 0.752800
|
||||
vn -0.134200 0.000000 0.990900
|
||||
vn -1.000000 0.000000 0.000000
|
||||
vn 0.000000 0.961700 -0.273900
|
||||
vn 0.178700 0.949500 -0.257800
|
||||
vn 0.457300 0.661600 -0.594300
|
||||
vn 0.151600 0.685100 -0.712500
|
||||
vn 0.000000 0.694500 -0.719500
|
||||
vn 0.939500 0.276000 -0.202600
|
||||
vn 0.631200 0.737600 -0.239800
|
||||
vn 0.632300 0.305000 -0.712100
|
||||
vn 0.135500 0.258500 -0.956400
|
||||
vn 0.000000 0.256900 -0.966400
|
||||
vn 0.979700 0.000000 -0.200600
|
||||
vn 0.658300 0.000000 -0.752800
|
||||
vn 0.134200 0.000000 -0.990900
|
||||
vn 0.000000 0.000000 -1.000000
|
||||
vn -0.178700 0.949500 -0.257800
|
||||
vn -0.457300 0.661600 -0.594300
|
||||
vn -0.631200 0.737600 -0.239800
|
||||
vn -0.939500 0.276000 -0.202600
|
||||
vn -0.151600 0.685100 -0.712500
|
||||
vn -0.135500 0.258500 -0.956400
|
||||
vn -0.632300 0.305000 -0.712100
|
||||
vn -0.658300 0.000000 -0.752800
|
||||
vn -0.979700 0.000000 -0.200600
|
||||
vn -0.134200 0.000000 -0.990900
|
||||
vn 0.000000 -0.961700 0.273900
|
||||
vn 0.000000 -1.000000 0.000000
|
||||
vn 0.194900 -0.980800 0.000000
|
||||
vn 0.178700 -0.949500 0.257800
|
||||
vn 0.647300 -0.762200 0.000000
|
||||
vn 0.457300 -0.661600 0.594300
|
||||
vn 0.151600 -0.685100 0.712500
|
||||
vn 0.000000 -0.694500 0.719500
|
||||
vn 0.961700 -0.274000 0.000000
|
||||
vn 0.939500 -0.276000 0.202600
|
||||
vn 0.631200 -0.737600 0.239800
|
||||
vn 0.632300 -0.305000 0.712100
|
||||
vn 0.135500 -0.258500 0.956400
|
||||
vn 0.000000 -0.256900 0.966400
|
||||
vn -0.194900 -0.980800 0.000000
|
||||
vn -0.647300 -0.762200 0.000000
|
||||
vn -0.178700 -0.949500 0.257800
|
||||
vn -0.457300 -0.661600 0.594300
|
||||
vn -0.631200 -0.737600 0.239800
|
||||
vn -0.939500 -0.276000 0.202600
|
||||
vn -0.961700 -0.274000 0.000000
|
||||
vn -0.151600 -0.685100 0.712500
|
||||
vn -0.135500 -0.258500 0.956400
|
||||
vn -0.632300 -0.305000 0.712100
|
||||
vn 0.000000 -0.961700 -0.273900
|
||||
vn 0.178700 -0.949500 -0.257800
|
||||
vn 0.457300 -0.661600 -0.594300
|
||||
vn 0.631200 -0.737600 -0.239800
|
||||
vn 0.000000 -0.694500 -0.719500
|
||||
vn 0.939500 -0.276000 -0.202600
|
||||
vn 0.151600 -0.685100 -0.712500
|
||||
vn 0.135500 -0.258500 -0.956400
|
||||
vn 0.000000 -0.256900 -0.966400
|
||||
vn 0.632300 -0.305000 -0.712100
|
||||
vn -0.178700 -0.949500 -0.257800
|
||||
vn -0.457300 -0.661600 -0.594300
|
||||
vn -0.151600 -0.685100 -0.712500
|
||||
vn -0.939500 -0.276000 -0.202600
|
||||
vn -0.631200 -0.737600 -0.239800
|
||||
vn -0.632300 -0.305000 -0.712100
|
||||
vn -0.135500 -0.258500 -0.956400
|
||||
usemtl Material.004
|
||||
s 1
|
||||
f 20/1/1 28/2/2 12/3/3
|
||||
f 18/4/4 20/5/1 4/6/5
|
||||
f 1/7/6 3/8/7 4/6/5
|
||||
f 4/6/5 12/3/3 9/9/8
|
||||
f 3/8/7 7/10/9 24/11/10
|
||||
f 1/7/6 2/12/11 6/13/12
|
||||
f 9/9/8 15/14/13 6/13/12
|
||||
f 1/7/6 5/15/14 7/10/9
|
||||
f 5/15/14 49/16/15 51/17/16
|
||||
f 15/14/13 63/18/17 50/19/18
|
||||
f 5/15/14 6/13/12 50/19/18
|
||||
f 7/10/9 51/17/16 76/20/19
|
||||
f 12/3/3 28/2/2 32/21/20
|
||||
f 13/22/21 32/23/20 29/24/22
|
||||
f 8/25/23 10/26/24 13/22/21
|
||||
f 9/9/8 12/3/3 13/22/21
|
||||
f 37/27/25 17/28/26 11/29/27
|
||||
f 8/25/23 14/30/28 16/31/29
|
||||
f 16/31/29 15/14/13 9/9/8
|
||||
f 17/28/26 14/30/28 8/25/23
|
||||
f 65/32/30 62/33/31 14/30/28
|
||||
f 64/34/32 63/18/17 15/14/13
|
||||
f 14/30/28 62/33/31 64/34/32
|
||||
f 94/35/33 65/32/30 17/28/26
|
||||
f 35/36/34 28/2/2 20/1/1
|
||||
f 23/37/35 20/5/1 18/4/4
|
||||
f 19/38/36 21/39/37 23/37/35
|
||||
f 31/40/38 35/36/34 23/41/35
|
||||
f 24/11/10 27/42/39 22/43/40
|
||||
f 19/38/36 25/44/41 26/45/42
|
||||
f 26/46/42 39/47/43 31/40/38
|
||||
f 27/42/39 25/44/41 19/38/36
|
||||
f 79/48/44 77/49/45 25/44/41
|
||||
f 78/50/46 96/51/47 39/47/43
|
||||
f 25/44/41 77/49/45 78/52/46
|
||||
f 76/20/19 79/48/44 27/42/39
|
||||
f 32/21/20 28/2/2 35/36/34
|
||||
f 29/24/22 32/23/20 36/53/48
|
||||
f 30/54/49 34/55/50 36/53/48
|
||||
f 36/56/48 35/36/34 31/40/38
|
||||
f 34/55/50 41/57/51 37/27/25
|
||||
f 30/54/49 33/58/52 40/59/53
|
||||
f 31/40/38 39/47/43 40/60/53
|
||||
f 30/54/49 38/61/54 41/57/51
|
||||
f 38/61/54 95/62/55 98/63/56
|
||||
f 39/47/43 96/51/47 97/64/57
|
||||
f 38/61/54 40/59/53 97/65/57
|
||||
f 41/57/51 98/63/56 94/35/33
|
||||
f 56/66/58 80/67/59 68/68/60
|
||||
f 45/69/61 68/70/60 66/71/62
|
||||
f 42/72/63 43/73/64 45/69/61
|
||||
f 53/74/65 56/66/58 45/69/61
|
||||
f 72/75/66 48/76/67 44/77/68
|
||||
f 42/72/63 46/78/69 47/79/70
|
||||
f 47/79/70 59/80/71 53/74/65
|
||||
f 48/76/67 46/78/69 42/72/63
|
||||
f 51/17/16 49/16/15 46/78/69
|
||||
f 50/19/18 63/18/17 59/80/71
|
||||
f 46/78/69 49/16/15 50/19/18
|
||||
f 76/20/19 51/17/16 48/76/67
|
||||
f 84/81/72 80/67/59 56/66/58
|
||||
f 81/82/73 84/83/72 57/84/74
|
||||
f 52/85/75 55/86/76 57/84/74
|
||||
f 57/84/74 56/66/58 53/74/65
|
||||
f 55/86/76 61/87/77 89/88/78
|
||||
f 52/85/75 54/89/79 60/90/80
|
||||
f 53/74/65 59/80/71 60/90/80
|
||||
f 52/85/75 58/91/81 61/87/77
|
||||
f 58/91/81 62/33/31 65/32/30
|
||||
f 59/80/71 63/18/17 64/34/32
|
||||
f 58/91/81 60/90/80 64/34/32
|
||||
f 61/87/77 65/32/30 94/35/33
|
||||
f 68/68/60 80/67/59 87/92/82
|
||||
f 66/71/62 68/70/60 71/93/83
|
||||
f 67/94/84 70/95/85 71/93/83
|
||||
f 71/96/83 87/92/82 83/97/86
|
||||
f 70/95/85 75/98/87 72/75/66
|
||||
f 67/94/84 69/99/88 74/100/89
|
||||
f 83/97/86 91/101/90 74/102/89
|
||||
f 67/94/84 73/103/91 75/98/87
|
||||
f 73/103/91 77/49/45 79/48/44
|
||||
f 91/101/90 96/104/47 78/105/46
|
||||
f 73/103/91 74/100/89 78/52/46
|
||||
f 75/98/87 79/48/44 76/20/19
|
||||
f 87/92/82 80/67/59 84/81/72
|
||||
f 88/106/92 84/83/72 81/82/73
|
||||
f 82/107/93 85/108/94 88/106/92
|
||||
f 83/97/86 87/92/82 88/109/92
|
||||
f 89/88/78 93/110/95 86/111/96
|
||||
f 82/107/93 90/112/97 92/113/98
|
||||
f 92/114/98 91/101/90 83/97/86
|
||||
f 93/110/95 90/112/97 82/107/93
|
||||
f 98/63/56 95/62/55 90/112/97
|
||||
f 97/115/57 96/104/47 91/101/90
|
||||
f 90/112/97 95/62/55 97/65/57
|
||||
f 94/35/33 98/63/56 93/110/95
|
||||
f 4/6/5 20/1/1 12/3/3
|
||||
f 3/8/7 18/4/4 4/6/5
|
||||
f 2/12/11 1/7/6 4/6/5
|
||||
f 2/12/11 4/6/5 9/9/8
|
||||
f 18/4/4 3/8/7 24/11/10
|
||||
f 5/15/14 1/7/6 6/13/12
|
||||
f 2/12/11 9/9/8 6/13/12
|
||||
f 3/8/7 1/7/6 7/10/9
|
||||
f 7/10/9 5/15/14 51/17/16
|
||||
f 6/13/12 15/14/13 50/19/18
|
||||
f 49/16/15 5/15/14 50/19/18
|
||||
f 24/11/10 7/10/9 76/20/19
|
||||
f 13/22/21 12/3/3 32/21/20
|
||||
f 11/29/27 13/22/21 29/24/22
|
||||
f 11/29/27 8/25/23 13/22/21
|
||||
f 10/26/24 9/9/8 13/22/21
|
||||
f 29/24/22 37/27/25 11/29/27
|
||||
f 10/26/24 8/25/23 16/31/29
|
||||
f 10/26/24 16/31/29 9/9/8
|
||||
f 11/29/27 17/28/26 8/25/23
|
||||
f 17/28/26 65/32/30 14/30/28
|
||||
f 16/31/29 64/34/32 15/14/13
|
||||
f 16/31/29 14/30/28 64/34/32
|
||||
f 37/27/25 94/35/33 17/28/26
|
||||
f 23/41/35 35/36/34 20/1/1
|
||||
f 22/43/40 23/37/35 18/4/4
|
||||
f 22/43/40 19/38/36 23/37/35
|
||||
f 21/116/37 31/40/38 23/41/35
|
||||
f 18/4/4 24/11/10 22/43/40
|
||||
f 21/39/37 19/38/36 26/45/42
|
||||
f 21/116/37 26/46/42 31/40/38
|
||||
f 22/43/40 27/42/39 19/38/36
|
||||
f 27/42/39 79/48/44 25/44/41
|
||||
f 26/46/42 78/50/46 39/47/43
|
||||
f 26/45/42 25/44/41 78/52/46
|
||||
f 24/11/10 76/20/19 27/42/39
|
||||
f 36/56/48 32/21/20 35/36/34
|
||||
f 34/55/50 29/24/22 36/53/48
|
||||
f 33/58/52 30/54/49 36/53/48
|
||||
f 33/117/52 36/56/48 31/40/38
|
||||
f 29/24/22 34/55/50 37/27/25
|
||||
f 38/61/54 30/54/49 40/59/53
|
||||
f 33/117/52 31/40/38 40/60/53
|
||||
f 34/55/50 30/54/49 41/57/51
|
||||
f 41/57/51 38/61/54 98/63/56
|
||||
f 40/60/53 39/47/43 97/64/57
|
||||
f 95/62/55 38/61/54 97/65/57
|
||||
f 37/27/25 41/57/51 94/35/33
|
||||
f 45/69/61 56/66/58 68/68/60
|
||||
f 44/77/68 45/69/61 66/71/62
|
||||
f 44/77/68 42/72/63 45/69/61
|
||||
f 43/73/64 53/74/65 45/69/61
|
||||
f 66/71/62 72/75/66 44/77/68
|
||||
f 43/73/64 42/72/63 47/79/70
|
||||
f 43/73/64 47/79/70 53/74/65
|
||||
f 44/77/68 48/76/67 42/72/63
|
||||
f 48/76/67 51/17/16 46/78/69
|
||||
f 47/79/70 50/19/18 59/80/71
|
||||
f 47/79/70 46/78/69 50/19/18
|
||||
f 72/75/66 76/20/19 48/76/67
|
||||
f 57/84/74 84/81/72 56/66/58
|
||||
f 55/86/76 81/82/73 57/84/74
|
||||
f 54/89/79 52/85/75 57/84/74
|
||||
f 54/89/79 57/84/74 53/74/65
|
||||
f 81/82/73 55/86/76 89/88/78
|
||||
f 58/91/81 52/85/75 60/90/80
|
||||
f 54/89/79 53/74/65 60/90/80
|
||||
f 55/86/76 52/85/75 61/87/77
|
||||
f 61/87/77 58/91/81 65/32/30
|
||||
f 60/90/80 59/80/71 64/34/32
|
||||
f 62/33/31 58/91/81 64/34/32
|
||||
f 89/88/78 61/87/77 94/35/33
|
||||
f 71/96/83 68/68/60 87/92/82
|
||||
f 70/95/85 66/71/62 71/93/83
|
||||
f 69/99/88 67/94/84 71/93/83
|
||||
f 69/118/88 71/96/83 83/97/86
|
||||
f 66/71/62 70/95/85 72/75/66
|
||||
f 73/103/91 67/94/84 74/100/89
|
||||
f 69/118/88 83/97/86 74/102/89
|
||||
f 70/95/85 67/94/84 75/98/87
|
||||
f 75/98/87 73/103/91 79/48/44
|
||||
f 74/102/89 91/101/90 78/105/46
|
||||
f 77/49/45 73/103/91 78/52/46
|
||||
f 72/75/66 75/98/87 76/20/19
|
||||
f 88/109/92 87/92/82 84/81/72
|
||||
f 86/111/96 88/106/92 81/82/73
|
||||
f 86/111/96 82/107/93 88/106/92
|
||||
f 85/119/94 83/97/86 88/109/92
|
||||
f 81/82/73 89/88/78 86/111/96
|
||||
f 85/108/94 82/107/93 92/113/98
|
||||
f 85/119/94 92/114/98 83/97/86
|
||||
f 86/111/96 93/110/95 82/107/93
|
||||
f 93/110/95 98/63/56 90/112/97
|
||||
f 92/114/98 97/115/57 91/101/90
|
||||
f 92/113/98 90/112/97 97/65/57
|
||||
f 89/88/78 94/35/33 93/110/95
|
||||
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 38 KiB |
@@ -0,0 +1,22 @@
|
||||
# Blender MTL File: 'Bricks.blend'
|
||||
# Material Count: 2
|
||||
|
||||
newmtl Arm
|
||||
Ns 96.078431
|
||||
Ka 0.000000 0.000000 0.000000
|
||||
Kd 0.640000 0.640000 0.640000
|
||||
Ks 0.250000 0.250000 0.250000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd texture.png
|
||||
|
||||
newmtl Brick
|
||||
Ns 96.078431
|
||||
Ka 0.000000 0.000000 0.000000
|
||||
Kd 0.640000 0.640000 0.640000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd White.png
|
||||
|
After Width: | Height: | Size: 839 KiB |
|
After Width: | Height: | Size: 3.2 MiB |
|
After Width: | Height: | Size: 3.0 MiB |
|
After Width: | Height: | Size: 926 KiB |
@@ -1,14 +1,14 @@
|
||||
# Blender MTL File: 'None'
|
||||
# Blender MTL File: 'Background.blend'
|
||||
# Material Count: 1
|
||||
|
||||
newmtl Material.001
|
||||
Ns 96.078431
|
||||
Ns 92.156863
|
||||
Ka 0.000000 0.000000 0.000000
|
||||
Kd 0.640000 0.640000 0.640000
|
||||
Kd 0.512000 0.512000 0.512000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd Test/Brick_Diffuse.png
|
||||
map_Bump Test/Brick_Normal.png
|
||||
map_Ks Test/Brick_Specular.png
|
||||
map_Kd Brunn_Diffuse.png
|
||||
map_Bump Brunn_Normals.png
|
||||
map_Ks Brunn_Specular.png
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
# Blender v2.75 (sub 0) OBJ File: ''
|
||||
# Blender v2.75 (sub 0) OBJ File: 'Background.blend'
|
||||
# www.blender.org
|
||||
mtllib Halfpipe.mtl
|
||||
o Cylinder
|
||||
v 0.000000 -2.908792 -1.000000
|
||||
v 0.000000 2.908792 -1.000000
|
||||
v 0.195090 -2.908792 -0.980785
|
||||
v 0.195090 2.908792 -0.980785
|
||||
v 0.000000 2.908792 -1.000000
|
||||
v 0.382683 -2.908792 -0.923880
|
||||
v 0.382683 2.908792 -0.923880
|
||||
v 0.555570 -2.908792 -0.831470
|
||||
@@ -19,11 +18,10 @@ v 0.923880 2.908792 -0.382683
|
||||
v 0.980785 -2.908792 -0.195090
|
||||
v 0.980785 2.908792 -0.195090
|
||||
v 1.000000 -2.908792 -0.000000
|
||||
v 1.000000 2.908792 -0.000000
|
||||
v -1.000000 -2.908792 -0.000001
|
||||
v -1.000000 2.908792 -0.000001
|
||||
v 1.000000 2.908792 0.000000
|
||||
v -0.980785 -2.908792 -0.195091
|
||||
v -0.980785 2.908792 -0.195091
|
||||
v -1.000000 2.908792 -0.000001
|
||||
v -0.923879 -2.908792 -0.382684
|
||||
v -0.923879 2.908792 -0.382684
|
||||
v -0.831469 -2.908792 -0.555571
|
||||
@@ -34,91 +32,91 @@ v -0.555569 -2.908792 -0.831470
|
||||
v -0.555569 2.908792 -0.831470
|
||||
v -0.382682 -2.908792 -0.923880
|
||||
v -0.382682 2.908792 -0.923880
|
||||
v -0.195089 -2.908792 -0.980786
|
||||
v 0.000000 -2.908792 -1.000000
|
||||
v -0.195089 2.908792 -0.980786
|
||||
vt -1.156714 -1.419990
|
||||
vt -1.158346 2.336063
|
||||
vt -1.031779 2.336118
|
||||
vt -1.283288 -1.420045
|
||||
vt -1.284913 2.336008
|
||||
vt -1.409862 -1.420100
|
||||
vt -1.411480 2.335954
|
||||
vt -1.536436 -1.420155
|
||||
vt -1.538048 2.335899
|
||||
vt 2.387354 -1.418355
|
||||
vt 2.385534 2.337692
|
||||
vt 2.512101 2.337753
|
||||
vt 2.260782 -1.418416
|
||||
vt 2.258967 2.337631
|
||||
vt 2.134208 -1.418478
|
||||
vt 2.132400 2.337570
|
||||
vt 2.007634 -1.418538
|
||||
vt 2.005832 2.337510
|
||||
vt -0.144122 -1.419541
|
||||
vt -0.145809 2.336510
|
||||
vt -0.019241 2.336567
|
||||
vt -0.270696 -1.419598
|
||||
vt -0.272376 2.336454
|
||||
vt -0.397270 -1.419654
|
||||
vt -0.398943 2.336397
|
||||
vt -0.523844 -1.419711
|
||||
vt -0.525511 2.336341
|
||||
vt -0.650418 -1.419767
|
||||
vt -0.652078 2.336285
|
||||
vt -0.776992 -1.419823
|
||||
vt -0.778645 2.336229
|
||||
vt -1.030140 -1.419935
|
||||
vt -0.905212 2.336174
|
||||
vt -0.903566 -1.419879
|
||||
vt 2.513929 -1.418293
|
||||
vt -0.017548 -1.419484
|
||||
vn -0.098000 0.000000 0.995200
|
||||
vn -0.290300 0.000000 0.956900
|
||||
vn -0.471400 0.000000 0.881900
|
||||
vn -0.634400 0.000000 0.773000
|
||||
vn -0.773000 0.000000 0.634400
|
||||
vn -0.881900 0.000000 0.471400
|
||||
vn -0.956900 0.000000 0.290300
|
||||
vn -0.995200 0.000000 0.098000
|
||||
vn 0.995200 0.000000 0.098000
|
||||
vn 0.956900 0.000000 0.290300
|
||||
vn 0.881900 0.000000 0.471400
|
||||
vn 0.773000 0.000000 0.634400
|
||||
vn 0.634400 0.000000 0.773000
|
||||
vn 0.471400 0.000000 0.881900
|
||||
vn 0.098000 0.000000 0.995200
|
||||
vn 0.290300 0.000000 0.956900
|
||||
v -0.195089 -2.908792 -0.980787
|
||||
v -1.000000 -2.908792 -0.000001
|
||||
vt 0.572383 0.000045
|
||||
vt 0.572387 1.000008
|
||||
vt 0.515062 1.000008
|
||||
vt 0.629704 0.000045
|
||||
vt 0.629712 1.000008
|
||||
vt 0.687026 0.000045
|
||||
vt 0.687036 1.000008
|
||||
vt 0.744348 0.000044
|
||||
vt 0.744361 1.000008
|
||||
vt 0.801670 0.000044
|
||||
vt 0.801686 1.000007
|
||||
vt 0.858992 0.000044
|
||||
vt 0.859011 1.000007
|
||||
vt 0.916314 0.000043
|
||||
vt 0.916335 1.000006
|
||||
vt 0.973636 0.000043
|
||||
vt 0.973661 1.000006
|
||||
vt 0.113808 0.000043
|
||||
vt 0.113788 1.000007
|
||||
vt 0.056463 1.000007
|
||||
vt 0.171130 0.000044
|
||||
vt 0.171113 1.000008
|
||||
vt 0.228452 0.000044
|
||||
vt 0.228437 1.000008
|
||||
vt 0.285774 0.000044
|
||||
vt 0.285762 1.000008
|
||||
vt 0.343096 0.000045
|
||||
vt 0.343087 1.000008
|
||||
vt 0.400418 0.000045
|
||||
vt 0.400412 1.000008
|
||||
vt 0.515061 0.000045
|
||||
vt 0.457737 1.000008
|
||||
vt 0.457739 0.000045
|
||||
vt 0.056486 0.000043
|
||||
vn -0.098000 -0.000000 0.995200
|
||||
vn -0.290300 -0.000000 0.956900
|
||||
vn -0.471400 -0.000000 0.881900
|
||||
vn -0.634400 -0.000000 0.773000
|
||||
vn -0.773000 -0.000000 0.634400
|
||||
vn -0.881900 -0.000000 0.471400
|
||||
vn -0.956900 -0.000000 0.290300
|
||||
vn -0.995200 -0.000000 0.098000
|
||||
vn 0.995200 -0.000000 0.098000
|
||||
vn 0.956900 -0.000000 0.290300
|
||||
vn 0.881900 -0.000000 0.471400
|
||||
vn 0.773000 -0.000000 0.634400
|
||||
vn 0.634400 -0.000000 0.773000
|
||||
vn 0.471400 -0.000000 0.881900
|
||||
vn 0.098000 -0.000000 0.995200
|
||||
vn 0.290300 -0.000000 0.956900
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 3/1/1 4/2/1 2/3/1
|
||||
f 5/4/2 6/5/2 4/2/2
|
||||
f 7/6/3 8/7/3 6/5/3
|
||||
f 9/8/4 10/9/4 8/7/4
|
||||
f 11/10/5 12/11/5 10/12/5
|
||||
f 13/13/6 14/14/6 12/11/6
|
||||
f 15/15/7 16/16/7 14/14/7
|
||||
f 17/17/8 18/18/8 16/16/8
|
||||
f 21/19/9 22/20/9 20/21/9
|
||||
f 23/22/10 24/23/10 22/20/10
|
||||
f 25/24/11 26/25/11 24/23/11
|
||||
f 27/26/12 28/27/12 26/25/12
|
||||
f 29/28/13 30/29/13 28/27/13
|
||||
f 31/30/14 32/31/14 30/29/14
|
||||
f 1/32/15 2/3/15 34/33/15
|
||||
f 33/34/16 34/33/16 32/31/16
|
||||
f 1/32/1 3/1/1 2/3/1
|
||||
f 3/1/2 5/4/2 4/2/2
|
||||
f 5/4/3 7/6/3 6/5/3
|
||||
f 7/6/4 9/8/4 8/7/4
|
||||
f 9/35/5 11/10/5 10/12/5
|
||||
f 11/10/6 13/13/6 12/11/6
|
||||
f 13/13/7 15/15/7 14/14/7
|
||||
f 15/15/8 17/17/8 16/16/8
|
||||
f 19/36/9 21/19/9 20/21/9
|
||||
f 21/19/10 23/22/10 22/20/10
|
||||
f 23/22/11 25/24/11 24/23/11
|
||||
f 25/24/12 27/26/12 26/25/12
|
||||
f 27/26/13 29/28/13 28/27/13
|
||||
f 29/28/14 31/30/14 30/29/14
|
||||
f 33/34/15 1/32/15 34/33/15
|
||||
f 31/30/16 33/34/16 32/31/16
|
||||
s 1
|
||||
f 1/1/1 2/2/1 3/3/1
|
||||
f 4/4/2 5/5/2 2/2/2
|
||||
f 6/6/3 7/7/3 5/5/3
|
||||
f 8/8/4 9/9/4 7/7/4
|
||||
f 10/10/5 11/11/5 9/9/5
|
||||
f 12/12/6 13/13/6 11/11/6
|
||||
f 14/14/7 15/15/7 13/13/7
|
||||
f 16/16/8 17/17/8 15/15/8
|
||||
f 18/18/9 19/19/9 20/20/9
|
||||
f 21/21/10 22/22/10 19/19/10
|
||||
f 23/23/11 24/24/11 22/22/11
|
||||
f 25/25/12 26/26/12 24/24/12
|
||||
f 27/27/13 28/28/13 26/26/13
|
||||
f 29/29/14 30/30/14 28/28/14
|
||||
f 31/31/15 3/3/15 32/32/15
|
||||
f 33/33/16 32/32/16 30/30/16
|
||||
f 31/31/1 1/1/1 3/3/1
|
||||
f 1/1/2 4/4/2 2/2/2
|
||||
f 4/4/3 6/6/3 5/5/3
|
||||
f 6/6/4 8/8/4 7/7/4
|
||||
f 8/8/5 10/10/5 9/9/5
|
||||
f 10/10/6 12/12/6 11/11/6
|
||||
f 12/12/7 14/14/7 13/13/7
|
||||
f 14/14/8 16/16/8 15/15/8
|
||||
f 34/34/9 18/18/9 20/20/9
|
||||
f 18/18/10 21/21/10 19/19/10
|
||||
f 21/21/11 23/23/11 22/22/11
|
||||
f 23/23/12 25/25/12 24/24/12
|
||||
f 25/25/13 27/27/13 26/26/13
|
||||
f 27/27/14 29/29/14 28/28/14
|
||||
f 33/33/15 31/31/15 32/32/15
|
||||
f 29/29/16 33/33/16 30/30/16
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# Blender MTL File: 'Sid.blend'
|
||||
# Material Count: 1
|
||||
|
||||
newmtl Derp
|
||||
Ns 96.078431
|
||||
Ka 0.000000 0.000000 0.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd SquidTexture.png
|
||||
|
After Width: | Height: | Size: 29 KiB |
@@ -51,10 +51,12 @@
|
||||
#include "Game/CBrickPart.h"
|
||||
#include "Game/CWall.h"
|
||||
#include "Game/CKraken.h"
|
||||
#include "Game/CNewWaterVolume.h"
|
||||
#include "Game/CBackground.h"
|
||||
#include "Game/CTravels.h"
|
||||
#include "Game/CStickyAim.h"
|
||||
#include "Game/BallSystem.h"
|
||||
#include "Game/LifeSystem.h"
|
||||
#include "Game/HitLagSystem.h"
|
||||
#include "Game/TravellingSystem.h"
|
||||
#include "Game/LifebuoySystem.h"
|
||||
@@ -84,6 +86,8 @@
|
||||
#include "GUI/Button.h"
|
||||
#include "Game/GUI/MainMenu.h"
|
||||
#include "Game/GUI/HUD.h"
|
||||
#include "Game/GUI/ELoadingFrameComplete.h"
|
||||
#include "Game/GUI/LoadingFrame.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
@@ -92,9 +96,15 @@ class Engine
|
||||
{
|
||||
|
||||
public:
|
||||
Engine(int argc, char* argv[]) {
|
||||
auto config = ResourceManager::Load<ConfigFile>("Config.ini");
|
||||
Engine(int argc, char* argv[])
|
||||
{
|
||||
ResourceManager::RegisterType<Texture>("Texture");
|
||||
ResourceManager::RegisterType<Model>("Model");
|
||||
ResourceManager::RegisterType<Sound>("Sound");
|
||||
ResourceManager::RegisterType<ConfigFile>("ConfigFile");
|
||||
ResourceManager::LoadPreloadsFromFile();
|
||||
|
||||
auto config = ResourceManager::Load<ConfigFile>("Config.ini");
|
||||
LOG_LEVEL = static_cast<_LOG_LEVEL>(config->GetValue<int>("Debug.LogLevel", 1));
|
||||
|
||||
m_EventBroker = std::make_shared<EventBroker>();
|
||||
@@ -112,15 +122,11 @@ public:
|
||||
m_FrameStack = new GUI::Frame(m_EventBroker.get());
|
||||
m_FrameStack->Width = 675;
|
||||
m_FrameStack->Height = 1080;
|
||||
|
||||
if (config->GetValue<bool>("Debug.SkipStory", false)) {
|
||||
Events::GameStart e;
|
||||
m_EventBroker->Publish(e);
|
||||
auto hud = new GUI::HUD(m_FrameStack, "HUD");
|
||||
}
|
||||
else {
|
||||
auto menu = new GUI::MainMenu(m_FrameStack, "MainMenu");
|
||||
}
|
||||
m_MainMenu = new GUI::MainMenu(m_FrameStack, "MainMenu");
|
||||
m_MainMenu->Hide();
|
||||
m_LoadingFrame = new GUI::LoadingFrame(m_FrameStack, "Loading");
|
||||
m_LoadingFrame->SetTexture("Textures/GUI/Loading.png");
|
||||
PreloadAllTheShit();
|
||||
|
||||
m_InputManager = std::make_shared<InputManager>(m_Renderer->Window(), m_EventBroker);
|
||||
|
||||
@@ -148,6 +154,7 @@ public:
|
||||
m_World->ComponentFactory.Register<Components::BrickPart>();
|
||||
m_World->ComponentFactory.Register<Components::Pad>();
|
||||
m_World->ComponentFactory.Register<Components::Wall>();
|
||||
m_World->ComponentFactory.Register<Components::NewWaterVolume>();
|
||||
m_World->ComponentFactory.Register<Components::Background>();
|
||||
m_World->ComponentFactory.Register<Components::Life>();
|
||||
m_World->ComponentFactory.Register<Components::Lifebuoy>();
|
||||
@@ -199,6 +206,9 @@ public:
|
||||
m_World->SystemFactory.Register<Systems::WaterSystem>(
|
||||
[this]() { return new Systems::WaterSystem(m_World.get(), m_EventBroker); });
|
||||
m_World->AddSystem<Systems::WaterSystem>();
|
||||
m_World->SystemFactory.Register<Systems::LifeSystem>(
|
||||
[this]() { return new Systems::LifeSystem(m_World.get(), m_EventBroker); });
|
||||
m_World->AddSystem<Systems::LifeSystem>();
|
||||
|
||||
m_World->ComponentFactory.Register<Components::Model>();
|
||||
m_World->ComponentFactory.Register<Components::Template>();
|
||||
@@ -210,15 +220,28 @@ public:
|
||||
|
||||
//auto particleEmitter= m_World->AddComponent<Components::Emitter>(Pe);
|
||||
|
||||
|
||||
|
||||
//EVENT_SUBSCRIBE_MEMBER(m_EGameStart, &Engine::OnGameStart);
|
||||
m_EGameStart = decltype(m_EGameStart)(std::bind(&Engine::OnGameStart, this, std::placeholders::_1));
|
||||
m_EventBroker->Subscribe(m_EGameStart);
|
||||
m_ELoadingFrameComplete = decltype(m_ELoadingFrameComplete)(std::bind(&Engine::OnLoadingFrameComplete, this, std::placeholders::_1));
|
||||
m_EventBroker->Subscribe(m_ELoadingFrameComplete);
|
||||
|
||||
m_LastTime = glfwGetTime();
|
||||
}
|
||||
|
||||
void PreloadAllTheShit()
|
||||
{
|
||||
if (ResourceManager::Load<ConfigFile>("Config.ini")->GetValue<bool>("Debug.SkipPreload", false)) {
|
||||
m_LoadingFrame->Hide();
|
||||
m_MainMenu->Show();
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto& pair : ResourceManager::GetPreloads()) {
|
||||
m_LoadingFrame->AddResource(pair.first, pair.second);
|
||||
}
|
||||
m_LoadingFrame->Preload();
|
||||
}
|
||||
|
||||
bool Running() const { return !glfwWindowShouldClose(m_Renderer->Window()); }
|
||||
|
||||
void Tick()
|
||||
@@ -418,6 +441,8 @@ public:
|
||||
private:
|
||||
std::shared_ptr<EventBroker> m_EventBroker;
|
||||
GUI::Frame* m_FrameStack = nullptr;
|
||||
GUI::MainMenu* m_MainMenu = nullptr;
|
||||
GUI::LoadingFrame* m_LoadingFrame = nullptr;
|
||||
std::shared_ptr<Renderer> m_Renderer;
|
||||
RenderQueueCollection m_RendererQueue;
|
||||
std::shared_ptr<InputManager> m_InputManager;
|
||||
@@ -447,6 +472,17 @@ private:
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
EventRelay<Engine, Events::LoadingFrameComplete> m_ELoadingFrameComplete;
|
||||
bool OnLoadingFrameComplete(const Events::LoadingFrameComplete& event)
|
||||
{
|
||||
if (event.FrameName == "Loading") {
|
||||
event.Frame->Hide();
|
||||
m_MainMenu->Show();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
double m_LastTime;
|
||||
};
|
||||
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
#include <string>
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <unordered_map>
|
||||
#include <fstream>
|
||||
|
||||
#include "Util/UnorderedMapPair.h"
|
||||
#include "Util/Factory.h"
|
||||
@@ -70,13 +72,8 @@ public:
|
||||
return s;
|
||||
}*/
|
||||
|
||||
/** Registers the factory function of a resource type
|
||||
|
||||
@tparam T Resource type.
|
||||
@param factoryFunction Lambda function that creates a new instance of the resource.
|
||||
*/
|
||||
template <typename T>
|
||||
static void RegisterType(std::function<Resource*(std::string)> factoryFunction);
|
||||
static void RegisterType(std::string typeName);
|
||||
|
||||
/** Preloads a resource and caches it for future use
|
||||
|
||||
@@ -85,6 +82,7 @@ public:
|
||||
*/
|
||||
template <typename T>
|
||||
static void Preload(std::string resourceName);
|
||||
static void Preload(std::string resourceType, std::string resourceName);
|
||||
|
||||
/** Checks if a resource is in cache
|
||||
|
||||
@@ -101,14 +99,7 @@ public:
|
||||
*/
|
||||
template <typename T>
|
||||
static T* Load(std::string resourceName, Resource* parent = nullptr);
|
||||
|
||||
/** Fetches a loaded resource
|
||||
|
||||
@tparam T Resource type.
|
||||
@param resourceName Fully qualified name of the resource to fetch.
|
||||
*/
|
||||
template <typename T>
|
||||
static T* Fetch(std::string resourceName);
|
||||
static Resource* Load(std::string resourceType, std::string resourceName, Resource* parent = nullptr);
|
||||
|
||||
/** Reloads an already loaded resource, keeping its resource ID intact.
|
||||
|
||||
@@ -116,14 +107,19 @@ public:
|
||||
@param resourceName Fully qualified name of the resource to reload.
|
||||
*/
|
||||
static void Reload(std::string resourceName);
|
||||
|
||||
static void LoadPreloadsFromFile();
|
||||
static const std::set<std::pair<std::string, std::string>>& GetPreloads() { return m_Preloads; }
|
||||
|
||||
static void Update();
|
||||
|
||||
private:
|
||||
static std::unordered_map<std::string, std::string> m_CompilerTypenameToResourceType;
|
||||
static std::unordered_map<std::string, std::function<Resource*(std::string)>> m_FactoryFunctions; // type -> factory function
|
||||
static std::unordered_map<std::pair<std::string, std::string>, Resource*> m_ResourceCache; // (type, name) -> resource
|
||||
static std::unordered_map<std::string, Resource*> m_ResourceFromName; // name -> resource
|
||||
static std::unordered_map<Resource*, Resource*> m_ResourceParents; // resource -> parent resource
|
||||
static std::set<std::pair<std::string, std::string>> m_Preloads; // (type, name)
|
||||
|
||||
// TODO: Getters for IDs
|
||||
static unsigned int m_CurrentResourceTypeID;
|
||||
@@ -140,93 +136,40 @@ private:
|
||||
static unsigned int GetNewResourceID(unsigned int typeID);
|
||||
|
||||
// Internal: Create a resource and cache it
|
||||
template <typename T>
|
||||
static T* CreateResource(std::string resourceName, Resource* parent);
|
||||
static Resource* CreateResource(std::string resourceType, std::string resourceName, Resource* parent);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
T* ResourceManager::Load(std::string resourceName, Resource* parent /* = nullptr */)
|
||||
{
|
||||
auto resourceType = typeid(T).name();
|
||||
auto it = m_ResourceCache.find(std::make_pair(resourceType, resourceName));
|
||||
if (it != m_ResourceCache.end())
|
||||
return static_cast<T*>(it->second);
|
||||
|
||||
if (m_Preloading) {
|
||||
LOG_INFO("Preloading resource \"%s\"", resourceName.c_str());
|
||||
} else {
|
||||
LOG_WARNING("Hot-loading resource \"%s\"", resourceName.c_str());
|
||||
}
|
||||
|
||||
return CreateResource<T>(resourceName, parent);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T* ResourceManager::Fetch(std::string resourceName)
|
||||
{
|
||||
auto resourceType = typeid(T).name();
|
||||
auto it = m_ResourceCache.find(std::make_pair(resourceType, resourceName));
|
||||
if (it == m_ResourceCache.end())
|
||||
{
|
||||
LOG_ERROR("Failed to fetch resource \"%s\": Resource not loaded!", resourceName.c_str());
|
||||
auto resourceTypename = typeid(T).name();
|
||||
auto it = m_CompilerTypenameToResourceType.find(resourceTypename);
|
||||
if (it == m_CompilerTypenameToResourceType.end()) {
|
||||
LOG_ERROR("Failed to load resource \"%s\" of type \"%s\": type not registered", resourceName.c_str(), resourceTypename);
|
||||
return nullptr;
|
||||
} else
|
||||
{
|
||||
return static_cast<T*>(it->second);
|
||||
}
|
||||
|
||||
return static_cast<T*>(Load(it->second, resourceName, parent));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void ResourceManager::RegisterType(std::function<Resource*(std::string)> factoryFunction)
|
||||
void ResourceManager::RegisterType(std::string typeName)
|
||||
{
|
||||
m_FactoryFunctions[typeid(T).name()] = factoryFunction;
|
||||
m_CompilerTypenameToResourceType[typeid(T).name()] = typeName;
|
||||
m_FactoryFunctions[typeName] = [](std::string resourceName) { return new T(resourceName); };
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void ResourceManager::Preload(std::string resourceName)
|
||||
{
|
||||
auto resourceType = typeid(T).name();
|
||||
if (IsResourceLoaded(resourceType, resourceName))
|
||||
{
|
||||
LOG_WARNING("Attempted to preload resource \"%s\" multiple times!", resourceName.c_str());
|
||||
auto resourceTypename = typeid(T).name();
|
||||
auto it = m_CompilerTypenameToResourceType.find(resourceTypename);
|
||||
if (it == m_CompilerTypenameToResourceType.end()) {
|
||||
LOG_ERROR("Failed to load resource \"%s\" of type \"%s\": type not registered", resourceName.c_str(), resourceTypename);
|
||||
return;
|
||||
}
|
||||
|
||||
m_Preloading = true;
|
||||
LOG_INFO("Preloading resource \"%s\"", resourceName.c_str());
|
||||
CreateResource<T>(resourceName, nullptr);
|
||||
m_Preloading = false;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T* ResourceManager::CreateResource(std::string resourceName, Resource* parent)
|
||||
{
|
||||
const char* resourceType = typeid(T).name();
|
||||
/*auto facIt = m_FactoryFunctions.find(resourceType);
|
||||
if (facIt == m_FactoryFunctions.end())
|
||||
{
|
||||
LOG_ERROR("Failed to load resource \"%s\" of type \"%s\": Type not registered", resourceName.c_str(), resourceType);
|
||||
return nullptr;
|
||||
}*/
|
||||
|
||||
// Call the factory function
|
||||
T* resource = new T(resourceName);
|
||||
// Store IDs
|
||||
resource->TypeID = GetTypeID(resourceType);
|
||||
resource->ResourceID = GetNewResourceID(resource->TypeID);
|
||||
// Cache
|
||||
m_ResourceCache[std::make_pair(resourceType, resourceName)] = resource;
|
||||
m_ResourceFromName[resourceName] = resource;
|
||||
if (parent != nullptr)
|
||||
{
|
||||
m_ResourceParents[resource] = parent;
|
||||
}
|
||||
if (!boost::filesystem::is_directory(resourceName))
|
||||
{
|
||||
LOG_DEBUG("Adding watch for %s", resourceName.c_str());
|
||||
m_FileWatcher.AddWatch(resourceName, fileWatcherCallback);
|
||||
}
|
||||
return resource;
|
||||
Preload(it->second, resourceName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef DAYDREAM_BALLSYSTEM_H
|
||||
#define DAYDREAM_BALLSYSTEM_H
|
||||
|
||||
#include <random>
|
||||
|
||||
#include "Core/System.h"
|
||||
#include "Core/World.h"
|
||||
#include "Core/EventBroker.h"
|
||||
@@ -8,14 +10,17 @@
|
||||
#include "Core/CTemplate.h"
|
||||
#include "Core/ResourceManager.h"
|
||||
#include "Core/ConfigFile.h"
|
||||
|
||||
#include "Physics/CPhysics.h"
|
||||
#include "Physics/CCircleShape.h"
|
||||
#include "Physics/CRectangleShape.h"
|
||||
#include "Physics/EContact.h"
|
||||
|
||||
#include "Rendering/CModel.h"
|
||||
#include "Rendering/CSprite.h"
|
||||
#include "Rendering/CPointLight.h"
|
||||
#include "Rendering/CAnimation.h"
|
||||
|
||||
#include "Game/CBall.h"
|
||||
#include "Game/CPowerUp.h"
|
||||
#include "Game/CLife.h"
|
||||
@@ -41,6 +46,7 @@
|
||||
#include "Game/EHitLag.h"
|
||||
#include "Game/EActionButton.h"
|
||||
#include "Game/ELifebuoyHit.h"
|
||||
|
||||
#include "Physics/ECreateParticleSequence.h"
|
||||
#include "Sound/CCollisionSound.h"
|
||||
|
||||
@@ -77,7 +83,6 @@ public:
|
||||
void OnEntityRemoved(EntityID entity) override;
|
||||
|
||||
EntityID CreateBall();
|
||||
void CreateLife(int);
|
||||
EntityID Ball() { return m_Ball; };
|
||||
void SetBall(const EntityID& ball) { m_Ball = ball; }
|
||||
|
||||
@@ -89,22 +94,18 @@ public:
|
||||
void SetEdgeY(const float& edgeY) { m_EdgeY = edgeY; }
|
||||
int& MultiBalls() { return m_MultiBalls; }
|
||||
void SetMultiBalls(const int& multiBalls) { m_MultiBalls = multiBalls; }
|
||||
int& Lives() { return m_Lives; }
|
||||
void SetLives(const int& lives) { m_Lives = lives; }
|
||||
int& PastLives() { return m_PastLives; }
|
||||
void SetPastLives(const int& pastLives) { m_PastLives = pastLives; }
|
||||
bool ReplaceBall() const { return m_ReplaceBall; }
|
||||
void SetReplaceBall(const bool& replaceBall) { m_ReplaceBall = replaceBall; }
|
||||
bool IsPaused() const { return m_Pause; }
|
||||
void SetPause(const bool& pause) { m_Pause = pause; }
|
||||
|
||||
private:
|
||||
std::mt19937 m_RandomGenerator;
|
||||
|
||||
float m_XMovementMultiplier = 2.f;
|
||||
float m_EdgeX = 3.4f; //Actually 3.2, but anyways.
|
||||
float m_EdgeY = 5.2f;
|
||||
int m_MultiBalls = 0;
|
||||
int m_Lives = 3;
|
||||
int m_PastLives = 3;
|
||||
bool m_ReplaceBall = false;
|
||||
bool m_Pause = false;
|
||||
bool m_Waiting = true;
|
||||
@@ -116,7 +117,8 @@ private:
|
||||
double m_KrakenCharge = 0;
|
||||
bool m_Restarting = false;
|
||||
int m_StickyCounter = 3;
|
||||
bool m_GodMode = false;
|
||||
|
||||
bool m_First = true;
|
||||
|
||||
bool m_StageBlockedWaiting = false;
|
||||
|
||||
@@ -128,7 +130,6 @@ private:
|
||||
std::unordered_map<EntityID, std::list<glm::vec2>> m_Contacts;
|
||||
void ResolveContacts();
|
||||
|
||||
dd::EventRelay<BallSystem, dd::Events::LifeLost> m_ELifeLost;
|
||||
dd::EventRelay<BallSystem, dd::Events::MultiBallLost> m_EMultiBallLost;
|
||||
dd::EventRelay<BallSystem, dd::Events::ResetBall> m_EResetBall;
|
||||
dd::EventRelay<BallSystem, dd::Events::MultiBall> m_EMultiBall;
|
||||
@@ -145,7 +146,6 @@ private:
|
||||
dd::EventRelay<BallSystem, dd::Events::ArrivedAtNewStage> m_EArrivedAtNewStage;
|
||||
|
||||
bool Contact(const Events::Contact &event);
|
||||
bool OnLifeLost(const dd::Events::LifeLost &event);
|
||||
bool OnMultiBallLost(const dd::Events::MultiBallLost &event);
|
||||
bool OnResetBall(const dd::Events::ResetBall &event);
|
||||
bool OnMultiBall(const dd::Events::MultiBall &event);
|
||||
|
||||
@@ -23,7 +23,9 @@ struct Ball : Component
|
||||
bool InkBlaster = false;
|
||||
bool Sticky = false;
|
||||
glm::vec3 StickyPlacement = glm::vec3(0, 0, 0);
|
||||
glm::vec3 SavedSpeed = glm::vec3(0, 0, 0);
|
||||
glm::vec3 SavedSpeed = glm::vec3(0, 1, 0);
|
||||
|
||||
int PosterBoy = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ struct Brick : Component
|
||||
int Type = 0;
|
||||
bool Removed = false;
|
||||
int Number = 100; // For the Kraken to keep track of which bricks needs replacing.
|
||||
bool BeingGenerated = false;
|
||||
glm::vec3 GenerationGoal;
|
||||
|
||||
//What number of types each is.
|
||||
const int EmptyBrickSpace = 0;
|
||||
|
||||
@@ -15,7 +15,8 @@ namespace Components
|
||||
|
||||
struct BrickPart : Component
|
||||
{
|
||||
|
||||
bool Submerged = false;
|
||||
int NumberOfPartsInBrick;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -13,10 +13,11 @@ namespace dd
|
||||
namespace Components
|
||||
{
|
||||
|
||||
struct Life : Component {
|
||||
|
||||
struct Life : Component
|
||||
{
|
||||
int Number = 0;
|
||||
|
||||
float SinusAltitude = 1;
|
||||
bool Left = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by Adniklastrator on 2015-10-22.
|
||||
//
|
||||
|
||||
#ifndef CNEWWATERVOLUME_H
|
||||
#define CNEWWATERVOLUME_H
|
||||
|
||||
#include "Core/Component.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
namespace Components
|
||||
{
|
||||
|
||||
struct NewWaterVolume : public Component
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_NEWWATERVOLUME_H
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "GUI/Slider.h"
|
||||
#include "Core/ResourceManager.h"
|
||||
#include "Game/GUI/ELoadingFrameComplete.h"
|
||||
#include "Sound/EPlaySound.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
@@ -29,9 +28,9 @@ public:
|
||||
m_Slider->X = Width / 2.f - m_Slider->Width / 2.f;
|
||||
}
|
||||
|
||||
void AddTexturePreload(std::string resourceName)
|
||||
void AddResource(std::string resourceType, std::string resourceName)
|
||||
{
|
||||
m_Items.push_back(resourceName);
|
||||
m_Preload.push_back(std::make_pair(resourceType, resourceName));
|
||||
}
|
||||
|
||||
void Preload()
|
||||
@@ -48,18 +47,15 @@ public:
|
||||
void Update(double dt) override
|
||||
{
|
||||
if (m_Preloading) {
|
||||
ResourceManager::Preload<dd::Texture>(m_Items[m_CurrentItem]);
|
||||
m_Slider->SetPercentage((m_CurrentItem + 1) / (float)m_Items.size());
|
||||
ResourceManager::Preload(m_Preload[m_CurrentItem].first, m_Preload[m_CurrentItem].second);
|
||||
m_Slider->SetPercentage((m_CurrentItem + 1) / (float)m_Preload.size());
|
||||
m_CurrentItem++;
|
||||
if (m_CurrentItem >= m_Items.size()) {
|
||||
if (m_CurrentItem >= m_Preload.size()) {
|
||||
m_Preloading = false;
|
||||
dd::Events::LoadingFrameComplete e;
|
||||
e.FrameName = Name();
|
||||
e.Frame = this;
|
||||
EventBroker->Publish(e);
|
||||
Events::PlaySound se;
|
||||
se.FilePath = "Sounds/jap-story.wav";
|
||||
EventBroker->Publish(se);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,7 +63,7 @@ public:
|
||||
private:
|
||||
bool m_Preloading = false;
|
||||
int m_CurrentItem = 0;
|
||||
std::vector<std::string> m_Items;
|
||||
std::vector<std::pair<std::string, std::string>> m_Preload;
|
||||
GUI::Slider* m_Slider = nullptr;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
#define GUI_MAINMENU_H__
|
||||
|
||||
#include "GUI/TextureFrame.h"
|
||||
#include "Game/GUI/LoadingFrame.h"
|
||||
#include "Game/GUI/MainMenuMain.h"
|
||||
#include "Game/GUI/MainMenuOptions.h"
|
||||
#include "Core/EKeyUp.h"
|
||||
#include "Game/EGameStart.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
@@ -37,6 +39,18 @@ public:
|
||||
//EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &MainMenu::OnKeyUp);
|
||||
}
|
||||
|
||||
void Show() override
|
||||
{
|
||||
if (ResourceManager::Load<ConfigFile>("Config.ini")->GetValue<bool>("Debug.SkipMenu", false)) {
|
||||
Events::GameStart e;
|
||||
EventBroker->Publish(e);
|
||||
Hide();
|
||||
auto hud = new GUI::HUD(BaseFrame, "HUD");
|
||||
} else {
|
||||
TextureFrame::Show();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
TextureFrame* m_LeftBanner;
|
||||
MainMenuMain* m_MainMenuMain;
|
||||
|
||||
@@ -58,6 +58,7 @@ private:
|
||||
if (event.Button == m_SquidoutButton) {
|
||||
m_Parent->Hide();
|
||||
auto story = new GUI::Story1(BaseFrame, "Story1");
|
||||
story->Play();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
|
||||
#include "Core/ResourceManager.h"
|
||||
#include "Game/GUI/StoryboardFrame.h"
|
||||
#include "Game/GUI/ELoadingFrameComplete.h"
|
||||
#include "Game/GUI/LoadingFrame.h"
|
||||
#include "Game/EGameStart.h"
|
||||
#include "Core/EKeyDown.h"
|
||||
#include "Game/GUI/HUD.h"
|
||||
#include "Sound/EPlaySound.h"
|
||||
#include "Sound/EStopSound.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
@@ -20,37 +20,8 @@ public:
|
||||
Story1(Frame* parent, std::string name)
|
||||
: StoryboardFrame(parent, name)
|
||||
{
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ELoadingFrameComplete, &Story1::OnLoadingFrameComplete);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKeyDown, &Story1::OnKeyDown);
|
||||
|
||||
m_LoadingFrame = new GUI::LoadingFrame(this, "Story1LoadingFrame");
|
||||
m_LoadingFrame->SetTexture("Textures/GUI/Loading.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/Brunn1.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/Brunn2.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/Brunn3.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/Brunn4.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/Brunn5.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene1.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene2.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene3.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene4.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene5.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene6.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene7.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene8.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene9.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene10.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene11.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene12.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene13.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene14.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene15.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene16.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene17.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene18.png");
|
||||
m_LoadingFrame->AddTexturePreload("Textures/Story/SubScene19.png");
|
||||
m_LoadingFrame->Preload();
|
||||
|
||||
m_Spacebar = new TextureFrame(this, "ZZZSpacebar");
|
||||
m_Spacebar->SetTexture("Textures/GUI/SpacebarSkip.png");
|
||||
m_Spacebar->SetRight(Right() - 10);
|
||||
@@ -196,6 +167,14 @@ public:
|
||||
AddTransition(t);
|
||||
}
|
||||
|
||||
virtual void Play() override
|
||||
{
|
||||
StoryboardFrame::Play();
|
||||
Events::PlaySound se;
|
||||
se.FilePath = "Sounds/jap-story.wav";
|
||||
EventBroker->Publish(se);
|
||||
}
|
||||
|
||||
void Update(double dt) override
|
||||
{
|
||||
StoryboardFrame::Update(dt);
|
||||
@@ -209,7 +188,6 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
GUI::LoadingFrame* m_LoadingFrame = nullptr;
|
||||
TextureFrame* m_Spacebar = nullptr;
|
||||
|
||||
EventRelay<Frame, Events::KeyDown> m_EKeyDown;
|
||||
@@ -220,25 +198,17 @@ private:
|
||||
}
|
||||
|
||||
if (event.KeyCode == GLFW_KEY_SPACE) {
|
||||
m_LoadingFrame->CancelPreload();
|
||||
Events::GameStart e;
|
||||
EventBroker->Publish(e);
|
||||
Events::StopSound se;
|
||||
se.FilePath = "Sounds/jap-story.wav";
|
||||
EventBroker->Publish(se);
|
||||
Hide();
|
||||
auto hud = new GUI::HUD(BaseFrame, "HUD");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
EventRelay<Frame, Events::LoadingFrameComplete> m_ELoadingFrameComplete;
|
||||
bool OnLoadingFrameComplete(const Events::LoadingFrameComplete& event)
|
||||
{
|
||||
if (event.FrameName == "Story1LoadingFrame") {
|
||||
event.Frame->Hide();
|
||||
m_Spacebar->Hide();
|
||||
Play();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -33,12 +33,12 @@ public:
|
||||
m_Timeline.push_back(transition);
|
||||
}
|
||||
|
||||
void Play()
|
||||
virtual void Play()
|
||||
{
|
||||
m_Playing = true;
|
||||
}
|
||||
|
||||
void Skip()
|
||||
virtual void Skip()
|
||||
{
|
||||
m_Playing = false;
|
||||
OnComplete();
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include "Game/CBall.h"
|
||||
#include "Game/CProjectile.h"
|
||||
#include "Sound/CCollisionSound.h"
|
||||
#include "Rendering/CAnimation.h"
|
||||
#include "Rendering/CSprite.h"
|
||||
//#include "Core/Camera.h" Camera Component
|
||||
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ private:
|
||||
|
||||
void GetNextLevel();
|
||||
void SetBrokenModel(EntityID entity);
|
||||
void CreateBrokenModelPart(EntityID Parent, std::string ModelPath, glm::vec3 RelativePosition, glm::vec2 Hitbox);
|
||||
void CreateBrokenModelPart(EntityID Parent, std::string ModelPath, glm::vec3 RelativePosition, glm::vec2 Hitbox, int NumberOfParts);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// Created by Adniklastrator on 2015-10-22.
|
||||
//
|
||||
|
||||
#ifndef DAYDREAM_LIFESYSTEM_H
|
||||
#define DAYDREAM_LIFESYSTEM_H
|
||||
|
||||
|
||||
#include "Core/System.h"
|
||||
#include "Core/CTransform.h"
|
||||
#include "Core/CTemplate.h"
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Core/World.h"
|
||||
|
||||
#include "Core/ConfigFile.h"
|
||||
|
||||
#include "Transform/EMove.h"
|
||||
#include "Rendering/CModel.h"
|
||||
|
||||
#include "Game/CLife.h"
|
||||
#include "Game/EPause.h"
|
||||
#include "Game/EResume.h"
|
||||
#include "Game/ELifeLost.h"
|
||||
#include "Game/EGameOver.h"
|
||||
#include "Game/EKrakenAttackEnd.h"
|
||||
|
||||
#include "Rendering/CAnimation.h"
|
||||
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
namespace Systems
|
||||
{
|
||||
|
||||
class LifeSystem : public System
|
||||
{
|
||||
public:
|
||||
LifeSystem(World* world, std::shared_ptr<dd::EventBroker> eventBroker)
|
||||
: System(world, eventBroker)
|
||||
{ }
|
||||
|
||||
|
||||
void Initialize() override;
|
||||
void Update(double dt) override;
|
||||
void UpdateEntity(double dt, EntityID entity, EntityID parent) override;
|
||||
|
||||
bool IsPaused() const { return m_Pause; }
|
||||
void SetPause(const bool& pause) { m_Pause = pause; }
|
||||
int& Lives() { return m_Lives; }
|
||||
void SetLives(const int& lives) { m_Lives = lives; }
|
||||
int& PastLives() { return m_PastLives; }
|
||||
void SetPastLives(const int& pastLives) { m_PastLives = pastLives; }
|
||||
|
||||
private:
|
||||
bool m_Pause = false;
|
||||
int m_Lives = 3;
|
||||
int m_PastLives = 3;
|
||||
float m_LifeSpeed = 0.8;
|
||||
|
||||
bool m_GodMode = false;
|
||||
|
||||
void CreateLife(int);
|
||||
|
||||
dd::EventRelay<LifeSystem, dd::Events::Pause> m_EPause;
|
||||
dd::EventRelay<LifeSystem, dd::Events::Resume> m_EResume;
|
||||
dd::EventRelay<LifeSystem, dd::Events::LifeLost> m_ELifeLost;
|
||||
|
||||
bool OnPause(const dd::Events::Pause &event);
|
||||
bool OnResume(const dd::Events::Resume &event);
|
||||
bool OnLifeLost(const dd::Events::LifeLost &event);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_LIFESYSTEM_H
|
||||
@@ -105,7 +105,11 @@ private:
|
||||
double m_KrakenStrength = 0;
|
||||
double m_PlayerStrength = 0;
|
||||
float m_Edge = 2.8f;
|
||||
EntityID m_KrakenArm;
|
||||
float m_PadOriginalHeight = -4.8;
|
||||
float m_PadHeight = m_PadOriginalHeight;
|
||||
EntityID m_KrakenArm = NULL;
|
||||
EntityID m_KrakenArmHitbox = NULL;
|
||||
float m_PadRiseSpeed = 0.2;
|
||||
Components::Transform* m_Transform = nullptr;
|
||||
Components::Pad* m_Pad = nullptr;
|
||||
std::shared_ptr<Components::Transform> m_StickTransform;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "Game/EStageCleared.h"
|
||||
#include "Game/CTravels.h"
|
||||
#include "Game/CBackground.h"
|
||||
#include "Game/CNewWaterVolume.h"
|
||||
|
||||
|
||||
namespace dd
|
||||
|
||||
@@ -11,9 +11,13 @@
|
||||
#include "Core/CTemplate.h"
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Core/World.h"
|
||||
#include "Core/ConfigFile.h"
|
||||
#include "Transform/EMove.h"
|
||||
#include "Physics/CPhysics.h"
|
||||
#include "Physics/CWaterVolume.h"
|
||||
#include "Physics/CRectangleShape.h"
|
||||
#include "Game/CBrickPart.h"
|
||||
#include "Game/CNewWaterVolume.h"
|
||||
#include "Game/EPause.h"
|
||||
#include "Game/EResume.h"
|
||||
#include "Game/ERelevantObjectCreated.h"
|
||||
@@ -47,6 +51,13 @@ public:
|
||||
private:
|
||||
bool m_Pause = false;
|
||||
EntityID m_BottomWall = 0;
|
||||
float m_SubmergedOriginalHeight = -4.5;
|
||||
float m_SubmergedHeight = m_SubmergedOriginalHeight;
|
||||
|
||||
bool m_RaiseWater = false;
|
||||
bool m_RemoveWater = false;
|
||||
|
||||
std::array<int, 10> m_BrickPartCounters;
|
||||
|
||||
dd::EventRelay<WaterSystem, dd::Events::Pause> m_EPause;
|
||||
dd::EventRelay<WaterSystem, dd::Events::Resume> m_EResume;
|
||||
|
||||
@@ -19,10 +19,12 @@
|
||||
#include "PrecompiledHeader.h"
|
||||
#include "Core/ResourceManager.h"
|
||||
|
||||
std::unordered_map<std::string, std::string> dd::ResourceManager::m_CompilerTypenameToResourceType;
|
||||
std::unordered_map<std::string, std::function<dd::Resource*(std::string)>> dd::ResourceManager::m_FactoryFunctions;
|
||||
std::unordered_map<std::pair<std::string, std::string>, dd::Resource*> dd::ResourceManager::m_ResourceCache;
|
||||
std::unordered_map<std::string, dd::Resource*> dd::ResourceManager::m_ResourceFromName;
|
||||
std::unordered_map<dd::Resource*, dd::Resource*> dd::ResourceManager::m_ResourceParents;
|
||||
std::set<std::pair<std::string, std::string>> dd::ResourceManager::m_Preloads; // (type, name)
|
||||
unsigned int dd::ResourceManager::m_CurrentResourceTypeID = 0;
|
||||
std::unordered_map<std::string, unsigned int> dd::ResourceManager::m_ResourceTypeIDs;
|
||||
std::unordered_map<unsigned int, unsigned int> dd::ResourceManager::m_ResourceCount;
|
||||
@@ -82,4 +84,86 @@ void dd::ResourceManager::fileWatcherCallback(std::string path, FileWatcher::Fil
|
||||
void dd::ResourceManager::Update()
|
||||
{
|
||||
m_FileWatcher.Check();
|
||||
}
|
||||
|
||||
void dd::ResourceManager::LoadPreloadsFromFile()
|
||||
{
|
||||
std::ifstream f("PreloadResources");
|
||||
while (f.good()) {
|
||||
std::string resourceType;
|
||||
std::string resourceName;
|
||||
f >> resourceType >> resourceName;
|
||||
if (!resourceType.empty() && !resourceType.empty()) {
|
||||
m_Preloads.insert(std::make_pair(resourceType, resourceName));
|
||||
}
|
||||
}
|
||||
f.close();
|
||||
}
|
||||
|
||||
void dd::ResourceManager::Preload(std::string resourceType, std::string resourceName)
|
||||
{
|
||||
if (IsResourceLoaded(resourceType, resourceName))
|
||||
{
|
||||
//LOG_WARNING("Attempted to preload resource \"%s\" multiple times!", resourceName.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
m_Preloading = true;
|
||||
LOG_INFO("Preloading resource \"%s\"", resourceName.c_str());
|
||||
CreateResource(resourceType, resourceName, nullptr);
|
||||
m_Preloading = false;
|
||||
}
|
||||
|
||||
dd::Resource* dd::ResourceManager::Load(std::string resourceType, std::string resourceName, dd::Resource* parent /*= nullptr*/)
|
||||
{
|
||||
auto it = m_ResourceCache.find(std::make_pair(resourceType, resourceName));
|
||||
if (it != m_ResourceCache.end())
|
||||
return it->second;
|
||||
|
||||
if (m_Preloading) {
|
||||
LOG_INFO("Preloading resource \"%s\"", resourceName.c_str());
|
||||
} else {
|
||||
LOG_WARNING("Hot-loading resource \"%s\"", resourceName.c_str());
|
||||
|
||||
if (!resourceType.empty() && !resourceName.empty()) {
|
||||
std::replace(resourceName.begin(), resourceName.end(), '\\', '/');
|
||||
if (m_Preloads.find(std::make_pair(resourceType, resourceName)) == m_Preloads.end()) {
|
||||
std::ofstream f("PreloadResources", std::ofstream::app);
|
||||
f << resourceType << " " << resourceName << std::endl;
|
||||
f.close();
|
||||
m_Preloads.insert(std::make_pair(resourceType, resourceName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return CreateResource(resourceType, resourceName, parent);
|
||||
}
|
||||
|
||||
dd::Resource* dd::ResourceManager::CreateResource(std::string resourceType, std::string resourceName, dd::Resource* parent)
|
||||
{
|
||||
auto facIt = m_FactoryFunctions.find(resourceType);
|
||||
if (facIt == m_FactoryFunctions.end())
|
||||
{
|
||||
LOG_ERROR("Failed to load resource \"%s\" of type \"%s\": type not registered", resourceName.c_str(), resourceType.c_str());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Call the factory function
|
||||
Resource* resource = facIt->second(resourceName);
|
||||
// Store IDs
|
||||
resource->TypeID = GetTypeID(resourceType);
|
||||
resource->ResourceID = GetNewResourceID(resource->TypeID);
|
||||
// Cache
|
||||
m_ResourceCache[std::make_pair(resourceType, resourceName)] = resource;
|
||||
m_ResourceFromName[resourceName] = resource;
|
||||
if (parent != nullptr)
|
||||
{
|
||||
m_ResourceParents[resource] = parent;
|
||||
}
|
||||
if (!boost::filesystem::is_directory(resourceName))
|
||||
{
|
||||
LOG_DEBUG("Adding watch for %s", resourceName.c_str());
|
||||
m_FileWatcher.AddWatch(resourceName, fileWatcherCallback);
|
||||
}
|
||||
return resource;
|
||||
}
|
||||
@@ -20,31 +20,36 @@ void dd::Systems::KrakenSystem::Initialize()
|
||||
|
||||
EntityID ent = m_World->CreateEntity();
|
||||
auto transform = m_World->AddComponent<Components::Transform>(ent);
|
||||
transform->Position = glm::vec3(50, 50, -10);
|
||||
auto model = m_World->AddComponent<Components::Model>(ent);
|
||||
model->ModelFile = "Models/Kraken/Body.dae";
|
||||
auto animationComponent = m_World->AddComponent<Components::Animation>(ent);
|
||||
animationComponent->Speed = 0.6f;
|
||||
|
||||
auto kraken = m_World->AddComponent<Components::Kraken>(ent);
|
||||
std::shared_ptr<Components::RectangleShape> cCircle = m_World->AddComponent<Components::RectangleShape>(ent);
|
||||
cCircle->Dimensions = glm::vec2(2, 4);
|
||||
|
||||
std::shared_ptr<Components::RectangleShape> cRect = m_World->AddComponent<Components::RectangleShape>(ent);
|
||||
cRect->Dimensions = glm::vec2(10.f, 4.f);
|
||||
|
||||
//cCircle->Radius = 2;
|
||||
std::shared_ptr<Components::Physics> cPhys = m_World->AddComponent<Components::Physics>(ent);
|
||||
std::shared_ptr<Components::Template> cTemplate = m_World->AddComponent<Components::Template>(ent);
|
||||
|
||||
auto travels = m_World->AddComponent<Components::Travels>(ent);
|
||||
travels->CurrentlyTraveling = false;
|
||||
|
||||
cPhys->CollisionType = CollisionType::Type::Static;
|
||||
cPhys->GravityScale = 0.f;
|
||||
cPhys->Category = CollisionLayer::Type::Brick;
|
||||
cPhys->Mask = static_cast<CollisionLayer::Type>(CollisionLayer::Type::Ball | CollisionLayer::Type::Projectile | CollisionLayer::Type::Wall | CollisionLayer::LifeBuoy);
|
||||
|
||||
model->ModelFile = "Models/Test/Ball/Sid.obj";
|
||||
transform->Position = glm::vec3(50, 50, -10);
|
||||
std::shared_ptr<Components::Template> cTemplate = m_World->AddComponent<Components::Template>(ent);
|
||||
|
||||
auto travels = m_World->AddComponent<Components::Travels>(ent);
|
||||
travels->CurrentlyTraveling = false;
|
||||
|
||||
|
||||
//sound
|
||||
auto collisionSound = m_World->AddComponent<Components::CollisionSound>(ent);
|
||||
collisionSound->FilePath = "Sounds/Brick/LTTP_Boss_Hit.wav";
|
||||
m_World->CommitEntity(ent);
|
||||
|
||||
m_KrakenTemplate = ent;
|
||||
|
||||
InitializeObjects();
|
||||
}
|
||||
|
||||
@@ -82,16 +87,16 @@ void dd::Systems::KrakenSystem::UpdateEntity(double dt, EntityID entity, EntityI
|
||||
case 1: // Idle
|
||||
m_KrakenTimer += dt;
|
||||
if (m_KrakenTimer > m_KrakenSecondsToAction) {
|
||||
m_KrakenTimer = 0;
|
||||
if (m_NumberOfActions == 0) {
|
||||
kraken->CurrentAction = 3;
|
||||
break;
|
||||
} else {
|
||||
std::uniform_real_distribution<float> dist(1, 4.999f);
|
||||
float random = dist(m_RandomGenerator);
|
||||
//std::cout << random << std::endl;
|
||||
kraken->CurrentAction = random;
|
||||
//std::cout << kraken->CurrentAction << std::endl;
|
||||
}
|
||||
m_KrakenTimer = 0;
|
||||
std::uniform_real_distribution<float> dist(1, 4.999f);
|
||||
float random = dist(m_RandomGenerator);
|
||||
//std::cout << random << std::endl;
|
||||
kraken->CurrentAction = random;
|
||||
//std::cout << kraken->CurrentAction << std::endl;
|
||||
}
|
||||
break;
|
||||
case 2: // Grabbing
|
||||
@@ -227,6 +232,7 @@ bool dd::Systems::KrakenSystem::OnKrakenAppear(const dd::Events::KrakenAppear &e
|
||||
m_World->RemoveComponent<Components::Template>(ent);
|
||||
auto transform = m_World->GetComponent<Components::Transform>(ent);
|
||||
transform->Position = event.Position;
|
||||
transform->Position.y += 3.f;
|
||||
m_KrakenBattle = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ void dd::Systems::LevelSystem::Initialize()
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EBrickGenerating, &LevelSystem::OnBrickGenerating);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKrakenDefeated, &LevelSystem::OnKrakenDefeated);
|
||||
|
||||
m_GodMode = ResourceManager::Load<ConfigFile>("Config.ini")->GetValue("Cheat.GodMode", false);
|
||||
m_GodMode = ResourceManager::Load<ConfigFile>("Config.ini")->GetValue<bool>("Cheat.GodMode", false);
|
||||
|
||||
//PointLightTest
|
||||
{
|
||||
@@ -61,8 +61,8 @@ void dd::Systems::LevelSystem::Initialize()
|
||||
auto travels = m_World->AddComponent<Components::Travels>(t_halfPipe);
|
||||
travels->CurrentlyTraveling = false;
|
||||
auto model = m_World->AddComponent<Components::Model>(t_halfPipe);
|
||||
model->ModelFile = "Models/Test/halfpipe/Halfpipe.obj";
|
||||
model->Color = glm::vec4(0.8f, 0.8f, 0.8f, 1.f);
|
||||
model->ModelFile = "Models/Halfpipe.obj";
|
||||
//model->Color = glm::vec4(0.8f, 0.8f, 0.8f, 1.f);
|
||||
m_World->CommitEntity(t_halfPipe);
|
||||
|
||||
auto t_halfPipe2 = m_World->CloneEntity(t_halfPipe);
|
||||
@@ -240,6 +240,7 @@ void dd::Systems::LevelSystem::Initialize()
|
||||
auto collisionSound = m_World->AddComponent<Components::CollisionSound>(m_BrickTemplate);
|
||||
collisionSound->FilePath = "Sounds/Brick/shortbrickbreak.wav";
|
||||
m_World->CommitEntity(m_BrickTemplate);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -278,18 +279,21 @@ void dd::Systems::LevelSystem::UpdateEntity(double dt, EntityID entity, EntityID
|
||||
}
|
||||
}
|
||||
|
||||
auto brickPart = m_World->GetComponent<Components::BrickPart>(entity);
|
||||
if (brickPart != nullptr) {
|
||||
auto transform = m_World->GetComponent<Components::Transform>(entity);
|
||||
if (transform->Position.y < -10) {
|
||||
m_World->RemoveEntity(entity);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
auto brick = m_World->GetComponent<Components::Brick>(entity);
|
||||
if (brick != nullptr) {
|
||||
auto transform = m_World->GetComponent<Components::Transform>(entity);
|
||||
|
||||
auto transform = m_World->GetComponent<Components::Transform>(entity);
|
||||
if (brick->BeingGenerated) {
|
||||
if (transform->Position == brick->GenerationGoal) {
|
||||
brick->BeingGenerated = false;
|
||||
auto cPhys = m_World->AddComponent<Components::Physics>(entity);
|
||||
cPhys->CollisionType = CollisionType::Type::Static;
|
||||
cPhys->GravityScale = 0.f;
|
||||
cPhys->Category = CollisionLayer::Type::Brick;
|
||||
cPhys->Mask = static_cast<CollisionLayer::Type>(CollisionLayer::Type::Ball | CollisionLayer::Type::Projectile | CollisionLayer::Type::Wall | CollisionLayer::LifeBuoy);
|
||||
}
|
||||
}
|
||||
|
||||
//Removes bricks that falls out of the stage.
|
||||
if (transform->Position.y < -10) {
|
||||
if (brick->Type == StandardBrick) {
|
||||
@@ -447,13 +451,15 @@ EntityID dd::Systems::LevelSystem::CreateBrick(int row, int line, glm::vec2 spac
|
||||
auto type = m_World->AddComponent<Components::StickyBrick>(brick);
|
||||
model->ModelFile = "Models/Brick/StickyBrick.obj";
|
||||
} else if (typeInt == InkBlasterBrick) {
|
||||
cBrick->Type = InkBlasterBrick;
|
||||
cBrick->Type = InkBlasterBrick;
|
||||
auto type = m_World->AddComponent<Components::InkBlasterBrick>(brick);
|
||||
model->Color = glm::vec4(0.1f, 0.1f, 0.1f, 1.0f);
|
||||
model->ModelFile = "Models/Brick/InkBrick.obj";
|
||||
model->Color = glm::vec4(0.7f, 0.7f, 0.7f, 1.f);
|
||||
} else if (typeInt == KrakenAttackBrick) {
|
||||
cBrick->Type = KrakenAttackBrick;
|
||||
auto type = m_World->AddComponent<Components::KrakenAttackBrick>(brick);
|
||||
model->Color = glm::vec4(0.f, 0.5f, 1.0f, 1.0f);
|
||||
model->ModelFile = "Models/Brick/KrakenBrick.obj";
|
||||
|
||||
} else if (typeInt == Kraken) {
|
||||
Events::KrakenAppear e;
|
||||
e.Position = transform->Position;
|
||||
@@ -487,6 +493,8 @@ bool dd::Systems::LevelSystem::BrickGenerating(const dd::Events::BrickGenerating
|
||||
auto ent = CreateBrick(i, j, SpaceBetweenBricks(), SpaceToEdge(), -3.2, 1, m_BrickSet[getter], m_ColorSet[getter]);
|
||||
if (ent != NULL) {
|
||||
auto brick = m_World->GetComponent<Components::Brick>(ent);
|
||||
brick->BeingGenerated = true;
|
||||
m_World->RemoveComponent<Components::Physics>(ent);
|
||||
brick->Number = getter;
|
||||
m_KrakenBricks[getter] = true;
|
||||
auto transform = m_World->GetComponent<Components::Transform>(ent);
|
||||
@@ -497,6 +505,7 @@ bool dd::Systems::LevelSystem::BrickGenerating(const dd::Events::BrickGenerating
|
||||
} else {
|
||||
transform->Position = event.Origin2;
|
||||
}
|
||||
brick->GenerationGoal = e.GoalPosition;
|
||||
e.Entity = ent;
|
||||
e.Speed = 6;
|
||||
e.Queue = false;
|
||||
@@ -696,7 +705,11 @@ bool dd::Systems::LevelSystem::OnContact(const dd::Events::Contact &event)
|
||||
brick = m_World->GetComponent<Components::Brick>(entityBrick);
|
||||
if (brick == nullptr) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (brick->BeingGenerated) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (entityShot != 0) {
|
||||
// For when a brick gets shot.
|
||||
@@ -1180,11 +1193,11 @@ void dd::Systems::LevelSystem::GetNextLevel()
|
||||
else if (m_CurrentLevel == 6) {
|
||||
level =
|
||||
{0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 100, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0};
|
||||
0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 100, 0, 0, 0 };
|
||||
color =
|
||||
{w, w, w, w, w, w, w,
|
||||
w, w, w, w, w, w, w,
|
||||
@@ -1216,40 +1229,45 @@ void dd::Systems::LevelSystem::SetBrokenModel(EntityID entity)
|
||||
std::uniform_int_distribution<int> dist(0, 2);
|
||||
int index = dist(m_RandomGenerator);
|
||||
|
||||
int parts = 0;
|
||||
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/1/WhiteBrickBreak1.obj", glm::vec3(-0.29912f, 0.0082f, 0.f), glm::vec2(0.281f, 0.351f));
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/1/WhiteBrickBreak2.obj", glm::vec3(0.07597f, -0.02899f, 0.f), glm::vec2(0.559f, 0.351f));
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/1/WhiteBrickBreak3.obj", glm::vec3(0.3227f, 0.05632, 0.f), glm::vec2(0.25f, 0.25f));
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/1/WhiteBrickBreak1.obj", glm::vec3(-0.29912f, 0.0082f, 0.f), glm::vec2(0.281f, 0.351f), 3);
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/1/WhiteBrickBreak2.obj", glm::vec3(0.07597f, -0.02899f, 0.f), glm::vec2(0.559f, 0.351f), 3);
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/1/WhiteBrickBreak3.obj", glm::vec3(0.3227f, 0.05632, 0.f), glm::vec2(0.25f, 0.25f), 3);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/2/WhiteBrickBreak1.obj", glm::vec3(-0.3236f, 0.0159f, 0.f), glm::vec2(0.237f, 0.327f));
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/2/WhiteBrickBreak2.obj", glm::vec3(0.07645f, 0.03131f, 0.f), glm::vec2(0.594f, 0.211f));
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/2/WhiteBrickBreak3.obj", glm::vec3(0.09468f, -0.11792f, 0.f), glm::vec2(0.692f, 0.112f));
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/2/WhiteBrickBreak4.obj", glm::vec3(0.33957f, 0.13079f, 0.f), glm::vec2(0.208f, 0.085f));
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/2/WhiteBrickBreak1.obj", glm::vec3(-0.3236f, 0.0159f, 0.f), glm::vec2(0.237f, 0.327f), 4);
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/2/WhiteBrickBreak2.obj", glm::vec3(0.07645f, 0.03131f, 0.f), glm::vec2(0.594f, 0.211f), 4);
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/2/WhiteBrickBreak3.obj", glm::vec3(0.09468f, -0.11792f, 0.f), glm::vec2(0.692f, 0.112f), 4);
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/2/WhiteBrickBreak4.obj", glm::vec3(0.33957f, 0.13079f, 0.f), glm::vec2(0.208f, 0.085f), 4);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/3/WhiteBrickBreak1.obj", glm::vec3(-0.34882f, 0.0564f, 0.f), glm::vec2(0.175f, 0.228f));
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/3/WhiteBrickBreak2.obj", glm::vec3(0.0678f, 0.07679f, 0.f), glm::vec2(0.699f, 0.183f));
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/3/WhiteBrickBreak3.obj", glm::vec3(-0.11862f, -0.10342, 0.f), glm::vec2(0.563f, 0.164f));
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/3/WhiteBrickBreak4.obj", glm::vec3(0.31479f, -0.06351f, 0.f), glm::vec2(0.261f, 0.21f));
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/3/WhiteBrickBreak1.obj", glm::vec3(-0.34882f, 0.0564f, 0.f), glm::vec2(0.175f, 0.228f), 4);
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/3/WhiteBrickBreak2.obj", glm::vec3(0.0678f, 0.07679f, 0.f), glm::vec2(0.699f, 0.183f), 4);
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/3/WhiteBrickBreak3.obj", glm::vec3(-0.11862f, -0.10342, 0.f), glm::vec2(0.563f, 0.164f), 4);
|
||||
CreateBrokenModelPart(entity, "Models/Brick/BrickBreak/3/WhiteBrickBreak4.obj", glm::vec3(0.31479f, -0.06351f, 0.f), glm::vec2(0.261f, 0.21f), 4);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_INFO("Something went wrong with the random generator in SetBrokenModel");
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void dd::Systems::LevelSystem::CreateBrokenModelPart(EntityID Parent, std::string ModelPath, glm::vec3 RelativePosition, glm::vec2 Hitbox)
|
||||
void dd::Systems::LevelSystem::CreateBrokenModelPart(EntityID Parent, std::string ModelPath, glm::vec3 RelativePosition, glm::vec2 Hitbox, int NumberOfParts)
|
||||
{
|
||||
auto ent = m_World->CreateEntity(Parent);
|
||||
auto cTemplate = m_World->AddComponent<Components::Template>(ent);
|
||||
auto cTransform = m_World->AddComponent<Components::Transform>(ent);
|
||||
auto cBrickPart = m_World->AddComponent<Components::BrickPart>(ent);
|
||||
cBrickPart->NumberOfPartsInBrick = NumberOfParts;
|
||||
|
||||
cTransform->Position = RelativePosition;
|
||||
|
||||
@@ -1262,6 +1280,7 @@ void dd::Systems::LevelSystem::CreateBrokenModelPart(EntityID Parent, std::strin
|
||||
auto cPhys = m_World->AddComponent<Components::Physics>(ent);
|
||||
cPhys->CollisionType = CollisionType::Type::Dynamic;
|
||||
cPhys->GravityScale = 1.f;
|
||||
cPhys->Density = 30;
|
||||
cPhys->Category = CollisionLayer::Type::Brick;
|
||||
cPhys->Mask = static_cast<CollisionLayer::Type>(CollisionLayer::Type::Wall);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
//
|
||||
// Created by Adniklastrator on 2015-10-13.
|
||||
//
|
||||
|
||||
#include "PrecompiledHeader.h"
|
||||
#include "Game/LifeSystem.h"
|
||||
|
||||
void dd::Systems::LifeSystem::Initialize()
|
||||
{
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &LifeSystem::OnPause);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &LifeSystem::OnResume);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ELifeLost, &LifeSystem::OnLifeLost);
|
||||
|
||||
for (int i = 0; i < Lives(); i++) {
|
||||
CreateLife(i);
|
||||
}
|
||||
|
||||
m_GodMode = ResourceManager::Load<ConfigFile>("Config.ini")->GetValue<bool>("Cheat.GodMode", false);
|
||||
}
|
||||
|
||||
void dd::Systems::LifeSystem::Update(double dt)
|
||||
{
|
||||
if (m_Pause) {
|
||||
return;
|
||||
}
|
||||
if (Lives() < 0) {
|
||||
Events::KrakenAttackEnd ek;
|
||||
EventBroker->Publish(ek);
|
||||
|
||||
Events::GameOver e;
|
||||
EventBroker->Publish(e);
|
||||
|
||||
Events::Pause p;
|
||||
p.Type = "All";
|
||||
EventBroker->Publish(p);
|
||||
|
||||
//TODO: Make this not so ugly
|
||||
SetLives(3);
|
||||
}
|
||||
}
|
||||
|
||||
void dd::Systems::LifeSystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
|
||||
{
|
||||
if (m_Pause) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto templateCheck = m_World->GetComponent<Components::Template>(entity);
|
||||
if (templateCheck != nullptr){ return; }
|
||||
auto life = m_World->GetComponent<Components::Life>(entity);
|
||||
|
||||
|
||||
if (life != nullptr) {
|
||||
auto transform = m_World->GetComponent<Components::Transform>(entity);
|
||||
if (life->Left) {
|
||||
if (transform->Position.x > 3) {
|
||||
life->Left = false;
|
||||
transform->Velocity.x = m_LifeSpeed;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (transform->Position.x < -3) {
|
||||
life->Left = true;
|
||||
transform->Velocity.x = -m_LifeSpeed;
|
||||
}
|
||||
}
|
||||
transform->Position.x += transform->Velocity.x * dt;
|
||||
/*glm::vec2 dir = glm::normalize(glm::vec2(transform->Velocity.x, transform->Velocity.y));
|
||||
glm::vec2 up = glm::vec2(0.f, 1.f);
|
||||
float angle = glm::acos(glm::dot<float>(dir, up)) * glm::sign(dir.x);
|
||||
transform->Orientation = glm::rotate(glm::quat(), angle, glm::vec3(0.f, 0.f, -1.f));*/
|
||||
if (Lives() != PastLives()) {
|
||||
if (life->Number + 1 == PastLives()) {
|
||||
m_World->RemoveEntity(entity);
|
||||
SetPastLives(Lives());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dd::Systems::LifeSystem::CreateLife(int number)
|
||||
{
|
||||
auto life = m_World->CreateEntity();
|
||||
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(life);
|
||||
transform->Position = glm::vec3(-1.5f + number * 0.15f, -2.f, -5.f);
|
||||
//transform->Position = glm::vec3(-1.5f + number * 1.5f, -3.f, -10.f);
|
||||
transform->Scale = glm::vec3(0.1f, 0.1f, 0.1f);
|
||||
//transform->Scale = glm::vec3(0.2f, 0.2f, 0.2f);
|
||||
|
||||
std::shared_ptr<Components::Life> lifeNr = m_World->AddComponent<Components::Life>(life);
|
||||
lifeNr->Number = number;
|
||||
|
||||
auto model = m_World->AddComponent<Components::Model>(life);
|
||||
model->ModelFile = "Models/Sid/Sid.dae";
|
||||
|
||||
auto anim = m_World->AddComponent<Components::Animation>(life);
|
||||
anim->Speed = 0.f;
|
||||
m_World->CommitEntity(life);
|
||||
}
|
||||
|
||||
bool dd::Systems::LifeSystem::OnLifeLost(const dd::Events::LifeLost &event)
|
||||
{
|
||||
if (!m_GodMode){
|
||||
SetLives(Lives() - 1);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::LifeSystem::OnPause(const dd::Events::Pause &event)
|
||||
{
|
||||
/*if (event.Type != "LifeSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}*/
|
||||
m_Pause = true;
|
||||
return true;
|
||||
}
|
||||
bool dd::Systems::LifeSystem::OnResume(const dd::Events::Resume &event)
|
||||
{
|
||||
/*if (event.Type != "LifeSystem" && event.Type != "All") {
|
||||
return false;
|
||||
}*/
|
||||
m_Pause = false;
|
||||
return true;
|
||||
}
|
||||
@@ -44,7 +44,7 @@ void dd::Systems::PadSystem::Initialize()
|
||||
auto ent = m_World->CreateEntity();
|
||||
m_World->SetProperty(ent, "Name", "Pad");
|
||||
auto ctransform = m_World->AddComponent<Components::Transform>(ent);
|
||||
ctransform->Position = glm::vec3(0.f, -4.8f, -10.f);
|
||||
ctransform->Position = glm::vec3(0.f, m_PadHeight, -10.f);
|
||||
auto rectangleShape = m_World->AddComponent<Components::RectangleShape>(ent);
|
||||
rectangleShape->Dimensions = glm::vec2(1.f, 0.1f);
|
||||
auto physics = m_World->AddComponent<Components::Physics>(ent);
|
||||
@@ -159,6 +159,13 @@ void dd::Systems::PadSystem::Update(double dt)
|
||||
auto pad = Pad();
|
||||
auto acceleration = Acceleration();
|
||||
|
||||
if (glm::abs(transform->Position.y - m_PadHeight) > m_PadRiseSpeed) {
|
||||
if (transform->Position.y < m_PadHeight) {
|
||||
transform->Position.y += m_PadRiseSpeed * (float)dt;
|
||||
} else if (transform->Position.y > m_PadHeight) {
|
||||
transform->Position.y -= m_PadRiseSpeed * 5 * (float)dt;
|
||||
}
|
||||
}
|
||||
if (transform->Velocity.x < -pad->MaxSpeed) {
|
||||
transform->Velocity.x = -pad->MaxSpeed;
|
||||
}
|
||||
@@ -420,6 +427,7 @@ bool dd::Systems::PadSystem::OnStageCleared(const dd::Events::StageCleared &even
|
||||
{
|
||||
//auto entity = CreateBall();
|
||||
m_StickyAim->Aiming = false;
|
||||
m_PadHeight = m_PadOriginalHeight;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -451,14 +459,8 @@ bool dd::Systems::PadSystem::OnRaiseWaterWall(const dd::Events::RaiseWaterWall &
|
||||
|
||||
bool dd::Systems::PadSystem::RaisePad(float amount, float speed)
|
||||
{
|
||||
auto transform = Transform();
|
||||
glm::vec3 raise = glm::vec3(0, amount, 0);
|
||||
Events::Move e;
|
||||
e.Entity = m_Entity;
|
||||
e.GoalPosition = transform->Position + raise;
|
||||
e.Speed = speed;
|
||||
e.Queue = true;
|
||||
EventBroker->Publish(e);
|
||||
m_PadHeight += amount;
|
||||
m_PadRiseSpeed = speed;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -474,16 +476,36 @@ bool dd::Systems::PadSystem::OnKrakenAttack(const dd::Events::KrakenAttack &even
|
||||
|
||||
transform->Velocity = glm::vec3(0, 0, 0);
|
||||
acceleration = glm::vec3(0, 0, 0);
|
||||
|
||||
LOG_INFO("Kraken arm duuude");
|
||||
if (!m_KrakenArm){
|
||||
LOG_INFO("InKrakenArmDuuude");
|
||||
m_KrakenArm = m_World->CreateEntity(Entity());
|
||||
auto transform = m_World->AddComponent<Components::Transform>(m_KrakenArm);
|
||||
transform->Position = glm::vec3(1.f, -3.0f, 0.f);
|
||||
auto model = m_World->AddComponent<Components::Model>(m_KrakenArm);
|
||||
model->ModelFile = "Models/kraken/Arm.dae";
|
||||
auto animation = m_World->AddComponent<Components::Animation>(m_KrakenArm);
|
||||
animation->Speed = 1.0f;
|
||||
model->ModelFile = "Models/Kraken/Arm.dae";
|
||||
auto animation = m_World->AddComponent<Components::Animation>(m_KrakenArm);
|
||||
animation->Speed = 1.0f;
|
||||
animation->Loop = false;
|
||||
m_World->CommitEntity(m_KrakenArm);
|
||||
|
||||
m_KrakenArmHitbox = m_World->CreateEntity();
|
||||
auto hb_transform = m_World->AddComponent<Components::Transform>(m_KrakenArmHitbox);
|
||||
hb_transform->Position = transform->Position + glm::vec3(-1.f, -5.0f, -10.f);
|
||||
//hb_transform->Position = glm::vec3(-2.f, -8.0f, -10.f);
|
||||
hb_transform->Scale = glm::vec3(2.5f, 2.5f, 1.f);
|
||||
hb_transform->Velocity = glm::vec3(0.f, 10.f, 0.f);
|
||||
//auto hb_sprite = m_World->AddComponent<Components::Sprite>(m_KrakenArmHitbox);
|
||||
//hb_sprite->SpriteFile = "Textures/Core/ErrorTexture.png";
|
||||
auto hb_physics = m_World->AddComponent<Components::Physics>(m_KrakenArmHitbox);
|
||||
hb_physics->Calculate = true;
|
||||
hb_physics->CollisionType = CollisionType::Type::Static;
|
||||
hb_physics->Category = CollisionLayer::Type::Other;
|
||||
hb_physics->Mask = CollisionLayer::Type::Water;
|
||||
hb_physics->GravityScale = 0.f;
|
||||
auto hb_HitBox = m_World->AddComponent<Components::CircleShape>(m_KrakenArmHitbox);
|
||||
hb_HitBox->Radius = 1.25f;
|
||||
m_World->CommitEntity(m_KrakenArmHitbox);
|
||||
}
|
||||
|
||||
SetTransform(transform);
|
||||
@@ -504,7 +526,9 @@ bool dd::Systems::PadSystem::OnKrakenAttackEnd(const dd::Events::KrakenAttackEnd
|
||||
m_PlayerStrength = 0;
|
||||
|
||||
m_World->RemoveEntity(m_KrakenArm);
|
||||
m_World->RemoveEntity(m_KrakenArmHitbox);
|
||||
m_KrakenArm = NULL;
|
||||
m_KrakenArmHitbox = NULL;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ void dd::Systems::WaterSystem::Initialize()
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ERaiseWater, &WaterSystem::OnRaiseWater);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ERaiseWaterWall, &WaterSystem::OnRaiseWaterWall);
|
||||
|
||||
m_RaiseWater = ResourceManager::Load<ConfigFile>("Config.ini")->GetValue<bool>("Debug.RaiseWater", false);
|
||||
|
||||
//Water test
|
||||
{
|
||||
auto t_waterBody = m_World->CreateEntity();
|
||||
@@ -24,6 +26,10 @@ void dd::Systems::WaterSystem::Initialize()
|
||||
auto body = m_World->AddComponent<Components::RectangleShape>(t_waterBody);
|
||||
m_World->CommitEntity(t_waterBody);
|
||||
}
|
||||
|
||||
m_BrickPartCounters =
|
||||
{0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0 };
|
||||
}
|
||||
|
||||
void dd::Systems::WaterSystem::Update(double dt)
|
||||
@@ -43,6 +49,31 @@ void dd::Systems::WaterSystem::UpdateEntity(double dt, EntityID entity, EntityID
|
||||
auto templateCheck = m_World->GetComponent<Components::Template>(entity);
|
||||
if (templateCheck != nullptr){ return; }
|
||||
|
||||
auto brickPart = m_World->GetComponent<Components::BrickPart>(entity);
|
||||
if (brickPart != nullptr) {
|
||||
auto transform = m_World->GetComponent<Components::Transform>(entity);
|
||||
if (m_RaiseWater) {
|
||||
if (!brickPart->Submerged) {
|
||||
if (transform->Position.y < m_SubmergedHeight) {
|
||||
brickPart->Submerged = true;
|
||||
m_BrickPartCounters[brickPart->NumberOfPartsInBrick]++;
|
||||
std::cout << "Parts: " << m_BrickPartCounters[brickPart->NumberOfPartsInBrick] << " of " << brickPart->NumberOfPartsInBrick << std::endl;
|
||||
if (m_BrickPartCounters[brickPart->NumberOfPartsInBrick] >= brickPart->NumberOfPartsInBrick) {
|
||||
m_BrickPartCounters[brickPart->NumberOfPartsInBrick] = 0;
|
||||
Events::RaiseWater e;
|
||||
e.Amount = 0.2;
|
||||
e.Speed = 0.2;
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (transform->Position.y < -10) {
|
||||
m_World->RemoveEntity(entity);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_BottomWall == 0) {
|
||||
for (auto it = m_World->GetEntities()->begin(); it != m_World->GetEntities()->end(); it++) {
|
||||
if (m_World->GetProperty<std::string>(it->first, "Name") == "BottomWall") {
|
||||
@@ -51,6 +82,21 @@ void dd::Systems::WaterSystem::UpdateEntity(double dt, EntityID entity, EntityID
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto newWater = m_World->GetComponent<Components::NewWaterVolume>(entity);
|
||||
if (newWater != nullptr) {
|
||||
if (m_RemoveWater) {
|
||||
//m_World->RemoveComponent<Components::WaterVolume>(entity);
|
||||
//m_World->RemoveComponent<Components::RectangleShape>(entity);
|
||||
//m_World->RemoveComponent<Components::WaterVolume>(entity);
|
||||
//m_World->RemoveEntity(entity);
|
||||
//m_World->RemoveComponent<Components::>();
|
||||
}
|
||||
/*auto transform = m_World->AddComponent<Components::Transform>(entity);
|
||||
if (transform->Position.y < -10) {
|
||||
m_World->RemoveEntity(entity);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
bool dd::Systems::WaterSystem::OnPause(const dd::Events::Pause &event)
|
||||
@@ -80,13 +126,14 @@ bool dd::Systems::WaterSystem::OnRelevantObjectCreated(const dd::Events::Relevan
|
||||
|
||||
bool dd::Systems::WaterSystem::OnStageCleared(const dd::Events::StageCleared &event)
|
||||
{
|
||||
|
||||
m_SubmergedHeight = m_SubmergedOriginalHeight;
|
||||
m_RemoveWater = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::WaterSystem::OnArrivedAtNewStage(const dd::Events::ArrivedAtNewStage &event)
|
||||
{
|
||||
|
||||
m_RemoveWater = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -95,13 +142,16 @@ bool dd::Systems::WaterSystem::OnRaiseWater(const dd::Events::RaiseWater &event)
|
||||
{
|
||||
auto t_waterBody = m_World->CreateEntity();
|
||||
auto transform = m_World->AddComponent<Components::Transform>(t_waterBody);
|
||||
transform->Position = glm::vec3(0.f, -3.5f, -10.f);
|
||||
transform->Scale = glm::vec3(7.0f, event.Amount * 1.6f, 1.f);
|
||||
transform->Position = glm::vec3(0.f, m_SubmergedHeight, -10.f);
|
||||
transform->Scale = glm::vec3(7.0f, event.Amount * 1.4f, 1.f);
|
||||
auto water = m_World->AddComponent<Components::WaterVolume>(t_waterBody);
|
||||
auto newWater = m_World->AddComponent<Components::NewWaterVolume>(t_waterBody); //Meaning it isn't the original water we had.
|
||||
auto body = m_World->AddComponent<Components::RectangleShape>(t_waterBody);
|
||||
m_World->CommitEntity(t_waterBody);
|
||||
}
|
||||
|
||||
m_SubmergedHeight += event.Amount;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ void dd::Systems::PhysicsSystem::InitializeWater()
|
||||
m_ParticleSystemDef.radius = radius;
|
||||
m_ParticleSystemDef.gravityScale = gravityScale;
|
||||
m_ParticleSystemDef.density = 4.f;
|
||||
m_ParticleSystemDef.surfaceTensionNormalStrength = 0.07;
|
||||
|
||||
m_WaterParticleSystem = m_PhysicsWorld->CreateParticleSystem(&m_ParticleSystemDef);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
|
||||
void dd::Renderer::Initialize()
|
||||
{
|
||||
ResourceManager::RegisterType<ShaderProgram>("ShaderProgram");
|
||||
ResourceManager::RegisterType<VertexShader>("VertexShader");
|
||||
ResourceManager::RegisterType<FragmentShader>("FragmentShader");
|
||||
|
||||
// Initialize GLFW
|
||||
if (!glfwInit()) {
|
||||
LOG_ERROR("GLFW: Initialization failed");
|
||||
|
||||