Browse Source

Count time on sides of objective; fix its physics

Changing the weight of the objective fixes the weird destroy-the-player
physics.

Also, count how long the objective has been tilted to the right or left,
and put counters there. Slow the game down and display who won when the
count exceeds 100% on either side. Like in overwatch, but with tilting.
master
Luna 7 years ago
parent
commit
a4d6a5020a
7 changed files with 658 additions and 188 deletions
  1. BIN
      assets/maze-high-obj.blend
  2. +423
    -0
      assets/maze-high-obj.obj
  3. +1
    -1
      scenes/heroes/0.tscn
  4. +172
    -0
      scenes/objective.tscn
  5. +1
    -1
      scenes/player.tscn
  6. +16
    -186
      scenes/world.tscn
  7. +45
    -0
      scripts/objective.gd

BIN
assets/maze-high-obj.blend View File


+ 423
- 0
assets/maze-high-obj.obj View File

@ -0,0 +1,423 @@
# Blender v2.79 (sub 0) OBJ File: 'maze-high-obj.blend'
# www.blender.org
mtllib maze-high-obj.mtl
o Cube
v 1.000000 -1.000000 -3.511225
v 1.000000 -1.000000 12.050566
v -85.561905 -1.000000 12.050565
v -85.561905 -1.000000 -3.511226
v 1.000000 -0.471266 -3.511225
v 0.999999 -0.471266 12.050567
v -85.561905 -0.471266 12.050565
v -85.561905 -0.471266 -3.511225
v 1.000000 -1.000000 11.276722
v 0.999999 -0.471266 11.276723
v -85.561905 -0.471266 11.276721
v 0.999999 3.666377 11.276723
v 0.999999 3.666377 12.050567
v -85.561905 3.666377 12.050565
v -85.561905 3.666377 11.276721
v -85.561905 -0.471266 -2.700100
v 1.000000 -1.000000 -2.700100
v 1.000000 -0.471266 -2.700100
v 1.000000 3.846691 -3.511225
v -85.561905 3.846691 -3.511225
v -85.561905 3.846691 -2.700100
v 1.000000 3.846691 -2.700100
v 1.000000 -1.000000 6.761319
v 1.000000 -0.471266 7.413254
v -85.561905 -0.471266 7.413253
v -85.561905 -0.471266 1.045964
v 1.000000 -1.000000 1.249698
v 1.000000 -0.471266 1.045964
v 1.000000 -1.000000 5.851443
v 1.000000 -0.471266 6.301361
v -85.561905 -0.471266 2.048380
v 1.000000 -1.000000 2.375701
v 1.000000 -0.471266 2.048381
v -36.923298 3.774218 2.048380
v -36.923298 3.774218 6.301360
v -36.923298 3.774218 1.045964
v -36.923298 3.774218 7.413254
v 1.000000 3.774218 6.301361
v 1.000000 3.774218 7.413254
v -85.561905 3.774218 2.048380
v -85.561905 3.774218 1.045964
v 1.000000 3.774218 1.045964
v 1.000000 3.774218 2.048381
v -14.047533 -1.000000 -3.511225
v -14.047533 -0.471266 -3.511225
v -14.047533 -0.471266 11.276722
v -14.047533 3.666377 12.050566
v -14.047533 3.666377 11.276722
v -14.047533 -0.471266 -2.700100
v -14.047533 3.846691 -3.511225
v -14.047533 3.846691 -2.700100
v -14.047533 -0.471266 7.413254
v -14.047533 -0.471266 1.045964
v -14.047533 -0.471266 6.301360
v -14.047533 -0.471266 2.048380
v -36.923298 -0.471266 2.048380
v -36.923298 -0.471266 6.301360
v -36.923298 -0.471266 1.045964
v -36.923298 -0.471266 7.413254
v -14.047533 3.774218 7.413254
v -14.047533 3.774218 1.045964
v -14.047533 3.774218 6.301360
v -14.047533 3.774218 2.048380
v -19.786369 -1.000000 -3.511225
v -19.786369 -0.471266 -3.511225
v -19.786369 3.666377 12.050566
v -19.786369 3.846691 -3.511225
v -19.786369 -0.471266 11.276722
v -19.786369 3.666377 11.276722
v -19.786369 -0.471266 -2.700100
v -19.786369 3.846691 -2.700100
v -19.786369 -0.471266 7.413254
v -19.786369 -0.471266 1.045964
v -19.786369 -0.471266 6.301360
v -19.786369 -0.471266 2.048380
v -36.923298 3.846691 -2.700100
v -36.923298 -0.471266 -2.700100
v -36.923298 3.666377 11.276722
v -36.923298 -0.471266 11.276722
v -19.786369 3.774218 7.413254
v -19.786369 3.774218 1.045964
v -19.786369 3.774218 6.301360
v -19.786369 3.774218 2.048380
v -25.763170 -1.000000 -3.511226
v -25.763170 -0.471266 -3.511225
v -25.763170 3.666377 12.050566
v -25.763170 3.846691 -3.511225
v -25.763170 -0.471266 11.276722
v -25.763170 3.666377 11.276722
v -25.763170 -0.471266 -2.700100
v -25.763170 3.846691 -2.700100
v -25.763170 -0.471266 7.413254
v -21.075886 -0.471266 1.045964
v -25.763170 -0.471266 6.301360
v -21.075886 -0.471266 2.048380
v -25.763170 3.774218 7.413254
v -21.075886 3.774218 1.045964
v -25.763170 3.774218 6.301360
v -21.075886 3.774218 2.048380
v -30.165419 -1.000000 -3.511226
v -30.165419 -0.471266 -3.511225
v -30.165419 3.666377 12.050566
v -30.165419 3.846691 -3.511225
v -30.165419 -0.471266 11.276722
v -30.165419 3.666377 11.276722
v -30.165419 -0.471266 -2.700100
v -30.165419 3.846691 -2.700100
v -30.165419 -0.471266 7.413254
v -25.053110 -0.471266 1.045964
v -30.165419 -0.471266 6.301360
v -25.053110 -0.471266 2.048380
v -36.923298 3.846691 -3.511225
v -36.923298 3.666377 12.050566
v -30.165419 3.774218 7.413254
v -25.053110 3.774218 1.045964
v -30.165419 3.774218 6.301360
v -25.053110 3.774218 2.048380
v -31.215120 -1.000000 -3.511226
v -31.215120 -0.471266 -3.511225
v -31.215120 3.666377 12.050566
v -31.215120 3.846691 -3.511225
v -31.215120 -0.471266 11.276722
v -31.215120 3.666377 11.276722
v -31.215120 -0.471266 -2.700100
v -31.215120 3.846691 -2.700100
v -31.215120 -0.471266 7.413254
v -31.215120 -0.471266 1.045964
v -31.215120 -0.471266 6.301360
v -31.215120 -0.471266 2.048380
v -36.923298 -0.471266 -3.511225
v -36.923298 -1.000000 -3.511226
v -31.215120 3.774218 7.413254
v -31.215120 3.774218 1.045964
v -31.215120 3.774218 6.301360
v -31.215120 3.774218 2.048380
v -44.335945 -1.000000 -3.511226
v -60.451035 -0.471266 -3.511225
v -39.251568 -0.471266 12.050566
v -39.251568 3.666377 12.050566
v -60.451035 3.846691 -3.511225
v -60.422035 3.774218 2.048380
v -50.303310 3.774218 6.301360
v -60.422035 3.774218 1.045964
v -50.303310 3.774218 7.413254
v -60.422035 -0.471266 2.048380
v -50.303310 -0.471266 6.301360
v -60.422035 -0.471266 1.045964
v -50.303310 -0.471266 7.413254
v -60.451035 3.846691 -2.700100
v -60.451035 -0.471266 -2.700100
v -39.251568 3.666377 11.276722
v -39.251568 -0.471266 11.276722
v -48.600723 -1.000000 -3.511226
v -64.715813 -0.471266 -3.511225
v -43.516346 -0.471266 12.050566
v -43.516346 3.666377 12.050566
v -64.715813 3.846691 -3.511225
v -64.686813 3.774218 2.048380
v -64.686813 3.774218 1.045964
v -64.686813 -0.471266 2.048380
v -64.686813 -0.471266 1.045964
v -85.567291 -0.471266 6.301360
v -64.715813 3.846691 -2.700100
v -64.715813 -0.471266 -2.700100
v -43.516346 3.666377 11.276722
v -43.516346 -0.471266 11.276722
v -85.684341 3.774218 6.301360
v -85.684341 3.774218 7.413254
v -85.684341 -0.471266 6.301360
v -85.684341 -0.471266 7.413254
v -55.445480 -0.471266 7.413254
v -55.445480 -0.471266 6.301360
v -55.445480 3.774218 7.413254
v -55.445480 3.774218 6.301360
v -101.792282 -1.000000 -3.511226
v -101.792282 -1.000000 12.050565
v -101.792282 -0.471266 12.050565
v -101.792282 -0.471266 -3.511225
v -85.561905 -1.000000 12.985348
v -85.561905 -0.471266 12.985348
v -101.792282 -1.000000 12.985348
v -101.792282 -0.471266 12.985348
v -102.458687 -1.000000 12.050565
v -102.458687 -0.471266 12.050565
v -102.458687 -1.000000 -3.511226
v -102.458687 -0.471266 -3.511225
v -85.561905 -1.000000 -4.127493
v -85.561905 -0.471266 -4.127493
v -101.792282 -0.471266 -4.127493
v -101.792282 -1.000000 -4.127493
v -85.561905 13.321682 -3.511225
v -101.792282 10.241516 -3.511225
v -85.561905 13.321683 -4.127492
v -101.792282 10.241517 -4.127492
v -101.792282 9.818419 12.050565
v -101.792282 10.220222 -3.511225
v -102.458687 10.044893 12.050565
v -102.458687 10.044893 -3.511225
v -85.561905 13.773964 12.985348
v -101.792282 9.826112 12.985348
v -85.561905 13.773964 12.050565
v -101.792282 9.826112 12.050565
v -85.740379 14.142629 -3.512197
v -101.970757 11.062463 -3.512197
v -101.970757 10.639365 12.049592
v -101.970757 11.041168 -3.512198
v -85.740379 14.594911 12.049592
v -101.970757 10.647058 12.049592
vn 0.0000 0.0000 -1.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 -1.0000 0.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 1.0000 0.0000
vn -0.0000 0.0000 1.0000
vn 0.0000 -0.9996 -0.0279
vn -0.1865 0.9825 0.0000
vn 0.0383 0.9992 0.0129
vn -0.2363 0.9717 0.0000
vn 0.0003 -0.0011 -1.0000
vn 0.2124 -0.9772 0.0012
vn -0.9772 -0.2124 0.0062
vn -0.0002 0.0011 1.0000
vn 0.0055 0.0000 -1.0000
vn -0.0055 -0.0000 1.0000
vn 0.9772 0.2124 0.0055
vn -0.2124 0.9772 -0.0012
usemtl Material
s off
f 166//1 11//1 15//1 165//1
f 9//2 10//2 6//2 2//2
f 162//3 31//3 25//3
f 154//1 153//1 4//1 8//1
f 23//2 24//2 10//2 9//2
f 6//2 10//2 12//2 13//2
f 8//4 16//4 21//4 20//4
f 1//2 5//2 18//2 17//2
f 157//5 20//5 21//5 163//5
f 49//6 18//6 22//6 51//6
f 154//1 8//1 20//1 157//1
f 18//2 5//2 19//2 22//2
f 29//2 30//2 24//2 23//2
f 17//2 18//2 28//2 27//2
f 164//5 16//5 26//5 161//5
f 32//2 33//2 30//2 29//2
f 27//2 28//2 33//2 32//2
f 178//1 175//1 185//1 186//1
f 33//2 28//2 42//2 43//2
f 122//1 79//1 78//1 123//1
f 119//1 118//1 131//1 130//1
f 126//5 59//5 79//5 122//5
f 159//5 41//5 40//5 158//5
f 26//4 31//4 40//4 41//4
f 24//2 30//2 38//2 39//2
f 55//6 33//6 43//6 63//6
f 161//1 26//1 41//1 159//1
f 52//6 24//6 39//6 60//6
f 28//1 53//1 61//1 42//1
f 30//1 54//1 62//1 38//1
f 75//6 55//6 63//6 83//6
f 42//5 61//5 63//5 43//5
f 38//5 62//5 60//5 39//5
f 123//5 78//5 113//5 120//5
f 121//5 112//5 76//5 125//5
f 33//5 55//5 54//5 30//5
f 18//5 49//5 53//5 28//5
f 5//1 45//1 50//1 19//1
f 70//6 49//6 51//6 71//6
f 19//5 50//5 51//5 22//5
f 12//5 48//5 47//5 13//5
f 24//5 52//5 46//5 10//5
f 5//1 1//1 44//1 45//1
f 10//1 46//1 48//1 12//1
f 136//3 131//3 118//3 100//3 84//3 64//3 44//3 1//3 17//3 27//3 32//3 29//3 23//3 9//3 2//3 3//3 176//3 175//3 4//3 153//3
f 90//6 70//6 71//6 91//6
f 119//1 130//1 112//1 121//1
f 95//6 75//6 83//6 99//6
f 92//6 72//6 80//6 96//6
f 53//1 73//1 81//1 61//1
f 61//5 81//5 83//5 63//5
f 124//5 77//5 58//5 127//5
f 55//5 75//5 74//5 54//5
f 49//5 70//5 73//5 53//5
f 45//1 65//1 67//1 50//1
f 50//5 67//5 71//5 51//5
f 48//5 69//5 66//5 47//5
f 52//5 72//5 68//5 46//5
f 45//1 44//1 64//1 65//1
f 46//1 68//1 69//1 48//1
f 60//4 62//4 54//4 52//4
f 52//5 54//5 74//5 72//5
f 80//2 72//2 74//2 82//2
f 108//2 110//2 116//2 114//2
f 93//5 109//5 111//5 95//5
f 129//5 56//5 57//5 128//5
f 106//6 90//6 91//6 107//6
f 73//1 93//1 97//1 81//1
f 74//1 94//1 98//1 82//1
f 81//5 97//5 99//5 83//5
f 82//5 98//5 96//5 80//5
f 134//5 35//5 37//5 132//5
f 75//5 95//5 94//5 74//5
f 70//5 90//5 93//5 73//5
f 65//1 85//1 87//1 67//1
f 67//5 87//5 91//5 71//5
f 69//5 89//5 86//5 66//5
f 72//5 92//5 88//5 68//5
f 65//1 64//1 84//1 85//1
f 68//1 88//1 89//1 69//1
f 124//6 106//6 107//6 125//6
f 133//5 36//5 34//5 135//5
f 128//1 57//1 35//1 134//1
f 129//6 111//6 117//6 135//6
f 126//6 108//6 114//6 132//6
f 92//5 94//5 110//5 108//5
f 117//2 111//2 109//2 115//2
f 92//4 96//4 98//4 94//4
f 127//1 58//1 36//1 133//1
f 95//4 99//4 97//4 93//4
f 95//5 111//5 110//5 94//5
f 90//5 106//5 109//5 93//5
f 85//1 101//1 103//1 87//1
f 87//5 103//5 107//5 91//5
f 89//5 105//5 102//5 86//5
f 92//5 108//5 104//5 88//5
f 85//1 84//1 100//1 101//1
f 138//6 155//6 7//6 3//6 2//6 6//6 13//6 47//6 66//6 86//6 102//6 120//6 113//6 139//6
f 88//1 104//1 105//1 89//1
f 59//6 126//6 132//6 37//6
f 56//6 129//6 135//6 34//6
f 148//6 59//6 37//6 144//6
f 145//6 56//6 34//6 141//6
f 77//6 124//6 125//6 76//6
f 109//1 127//1 133//1 115//1
f 110//1 128//1 134//1 116//1
f 115//5 133//5 135//5 117//5
f 116//5 134//5 132//5 114//5
f 150//6 77//6 76//6 149//6
f 111//5 129//5 128//5 110//5
f 106//5 124//5 127//5 109//5
f 101//1 119//1 121//1 103//1
f 103//5 121//5 125//5 107//5
f 105//5 123//5 120//5 102//5
f 108//5 126//5 122//5 104//5
f 101//1 100//1 118//1 119//1
f 104//1 122//1 123//1 105//1
f 108//4 104//4 105//4 114//4
f 126//2 132//2 123//2 122//2
f 123//7 132//7 114//7 105//7
f 150//4 149//4 140//4 137//4
f 146//3 148//3 171//3 172//3
f 58//1 147//1 143//1 36//1
f 57//1 146//1 142//1 35//1
f 36//5 143//5 141//5 34//5
f 35//5 142//5 144//5 37//5
f 77//5 150//5 147//5 58//5
f 130//1 137//1 140//1 112//1
f 112//5 140//5 149//5 76//5
f 78//5 151//5 139//5 113//5
f 130//1 131//1 136//1 137//1
f 79//1 152//1 151//1 78//1
f 31//6 160//6 158//6 40//6
f 16//6 164//6 163//6 21//6
f 7//6 155//6 156//6 14//6
f 147//1 161//1 159//1 143//1
f 158//6 160//6 145//6 141//6
f 143//5 159//5 158//5 141//5
f 150//5 164//5 161//5 147//5
f 137//5 154//5 164//5 150//5
f 164//2 154//2 157//2 163//2
f 137//1 136//1 153//1 154//1
f 138//4 139//4 151//4 152//4
f 174//1 172//1 169//1 167//1
f 172//3 171//3 170//3 169//3
f 11//4 7//4 14//4 15//4
f 173//5 174//5 167//5 168//5
f 170//4 168//4 167//4 169//4
f 25//5 148//5 146//5 57//5 56//5 145//5 160//5 31//5 26//5 16//5 8//5 178//5 177//5 7//5 11//5
f 3//2 7//2 180//2 179//2
f 165//5 15//5 14//5 156//5
f 155//2 166//2 165//2 156//2
f 177//4 176//4 181//4 182//4
f 138//5 152//5 166//5 155//5
f 171//6 173//6 168//6 170//6
f 25//5 11//5 166//5 152//5 79//5 59//5
f 7//1 177//1 202//1 201//1
f 4//3 175//3 190//3 187//3
f 179//6 180//6 182//6 181//6
f 176//3 3//3 179//3 181//3
f 172//2 174//2 173//2 171//2
f 144//2 148//2 146//2 142//2
f 184//4 186//4 185//4 183//4
f 184//6 177//6 195//6 197//6
f 175//3 176//3 183//3 185//3
f 176//6 177//6 184//6 183//6
f 188//1 187//1 190//1 189//1
f 175//4 178//4 189//4 190//4
f 8//2 4//2 187//2 188//2
f 8//2 188//2 193//2 191//2
f 192//8 191//8 193//8 194//8
f 178//6 8//6 191//6 192//6
f 188//1 189//1 194//1 193//1
f 189//4 178//4 192//4 194//4
f 195//9 196//9 198//9 197//9
f 177//2 178//2 196//2 195//2
f 178//1 186//1 198//1 196//1
f 186//4 184//4 197//4 198//4
f 201//10 202//10 200//10 199//10
f 180//2 7//2 201//2 199//2
f 182//6 180//6 199//6 200//6
f 177//4 182//4 200//4 202//4
f 201//11 202//11 208//11 207//11
f 207//12 208//12 205//12 206//12 204//12 203//12
f 191//13 201//13 207//13 203//13
f 192//14 191//14 203//14 204//14
f 202//15 195//15 205//15 208//15
f 196//16 192//16 204//16 206//16
f 195//17 196//17 206//17 205//17
f 201//18 191//18 192//18 196//18 195//18 202//18
l 146 162

+ 1
- 1
scenes/heroes/0.tscn View File

@ -34,7 +34,7 @@ friction = 1.0
bounce = 0.0
gravity_scale = 1.0
custom_integrator = false
continuous_cd = false
continuous_cd = true
contacts_reported = 4
contact_monitor = true
sleeping = false


+ 172
- 0
scenes/objective.tscn View File

@ -0,0 +1,172 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://scripts/objective.gd" type="Script" id=1]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 7, 0.25, 7 )
[sub_resource type="CubeMesh" id=2]
size = Vector3( 14, 0.5, 14 )
subdivide_width = 0
subdivide_height = 0
subdivide_depth = 0
[sub_resource type="CapsuleShape" id=3]
radius = 0.5
height = 14.0
[node name="FullObjective" type="Spatial" index="0"]
[node name="Objective" type="RigidBody" parent="." index="0"]
input_ray_pickable = true
input_capture_on_drag = false
collision_layer = 1
collision_mask = 1
mode = 0
mass = 1000.0
friction = 1.0
bounce = 0.0
gravity_scale = 1.0
custom_integrator = false
continuous_cd = true
contacts_reported = 8
contact_monitor = true
sleeping = false
can_sleep = true
axis_lock_linear_x = false
axis_lock_linear_y = false
axis_lock_linear_z = false
axis_lock_angular_x = false
axis_lock_angular_y = false
axis_lock_angular_z = false
linear_velocity = Vector3( 0, 0, 0 )
linear_damp = -1.0
angular_velocity = Vector3( 0, 0, 0 )
angular_damp = -1.0
script = ExtResource( 1 )
_sections_unfolded = [ "Axis Lock", "Collision", "Linear", "Transform", "Visibility" ]
[node name="CollisionShape" type="CollisionShape" parent="Objective" index="0"]
shape = SubResource( 1 )
disabled = false
_sections_unfolded = [ "Transform" ]
[node name="MeshInstance5" type="MeshInstance" parent="Objective/CollisionShape" index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.274852 )
layers = 1
material_override = null
cast_shadow = 1
extra_cull_margin = 0.0
use_in_baked_light = false
lod_min_distance = 0.0
lod_min_hysteresis = 0.0
lod_max_distance = 0.0
lod_max_hysteresis = 0.0
mesh = SubResource( 2 )
skeleton = NodePath("..")
material/0 = null
_sections_unfolded = [ "Transform" ]
[node name="HingeJoint" type="HingeJoint" parent="." index="1"]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0, -0.25, 0 )
nodes/node_a = NodePath("../Objective")
nodes/node_b = NodePath("../Rod")
solver/priority = 1
collision/exclude_nodes = true
params/bias = 0.3
angular_limit/enable = false
angular_limit/upper = 90.0
angular_limit/lower = -90.0
angular_limit/bias = 0.3
angular_limit/softness = 0.9
angular_limit/relaxation = 1.0
motor/enable = false
motor/target_velocity = 1.0
motor/max_impulse = 1.0
_sections_unfolded = [ "Transform", "Visibility", "angular_limit", "collision", "motor", "nodes", "params", "solver" ]
[node name="Rod" type="StaticBody" parent="." index="2"]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0, -0.75, 0 )
input_ray_pickable = true
input_capture_on_drag = false
collision_layer = 1
collision_mask = 1
friction = 1.0
bounce = 0.0
constant_linear_velocity = Vector3( 0, 0, 0 )
constant_angular_velocity = Vector3( 0, 0, 0 )
_sections_unfolded = [ "Collision", "Transform" ]
[node name="CollisionShape" type="CollisionShape" parent="Rod" index="0"]
shape = SubResource( 3 )
disabled = false
_sections_unfolded = [ "Transform", "Visibility" ]
[node name="LeftTeam" type="Label" parent="." index="3"]
anchor_left = 0.5
anchor_top = 0.0
anchor_right = 0.5
anchor_bottom = 0.0
margin_left = -66.0
margin_top = 35.0
margin_right = -26.0
margin_bottom = 66.0
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "0%"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Theme" ]
[node name="RightTeam" type="Label" parent="." index="4"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 507.0
margin_top = 35.0
margin_right = 547.0
margin_bottom = 49.0
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "0%"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Finish" type="Label" parent="." index="5"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 40.0
margin_bottom = 14.0
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1

+ 1
- 1
scenes/player.tscn View File

@ -34,7 +34,7 @@ friction = 1.0
bounce = 0.0
gravity_scale = 1.0
custom_integrator = false
continuous_cd = false
continuous_cd = true
contacts_reported = 0
contact_monitor = false
sleeping = false


+ 16
- 186
scenes/world.tscn
File diff suppressed because it is too large
View File


+ 45
- 0
scripts/objective.gd View File

@ -0,0 +1,45 @@
extends RigidBody
var left = 0
var right = 0
var active = false
var right_active = false
var activation_margin = 0.1
var build_rate = 1
func _integrate_forces(state):
var rot = get_rotation().x
if active:
activation_margin = 0
if rot < -activation_margin:
active = true
right_active = false
if rot > activation_margin:
active = true
right_active = true
if active:
if right_active:
get_node("../HUD/LeftTeam").add_color_override("font_color_shadow", Color(0,0,0,0))
get_node("../HUD/RightTeam").add_color_override("font_color_shadow", Color(1,0,0))
else:
get_node("../HUD/LeftTeam").add_color_override("font_color_shadow", Color(1,0,0))
get_node("../HUD/RightTeam").add_color_override("font_color_shadow", Color(0,0,0,0))
func _process(delta):
if active:
if right_active:
right += delta * build_rate
else:
left += delta * build_rate
if left >= 100:
get_node("../HUD/Finish").set_text("Left wins!")
Engine.set_time_scale(0.1)
left = 100
if right >= 100:
get_node("../HUD/Finish").set_text("Left wins!")
Engine.set_time_scale(0.1)
right = 100
get_node("../HUD/LeftTeam").set_text("%d%%" % left)
get_node("../HUD/RightTeam").set_text("%d%%" % right)

Loading…
Cancel
Save