.
This commit is contained in:
@@ -23,11 +23,12 @@ class Kart:
|
||||
def tick(self, input: Input):
|
||||
input_x = input.horizontal()
|
||||
input_y = input.vertical()
|
||||
assert abs(input_x) < 1
|
||||
assert abs(input_y) < 1
|
||||
assert abs(input_x) <= 1
|
||||
assert abs(input_y) <= 1
|
||||
|
||||
acc_amount = input_y * 2
|
||||
self.vel += Vec2(acc_amount, 0).rotate(self.dir)
|
||||
self.vel *= 0.9
|
||||
steer = input_x * 2
|
||||
self.dir += steer
|
||||
|
||||
@@ -44,8 +45,8 @@ class Kart:
|
||||
|
||||
def consume_item(self, item: Item):
|
||||
if item.kind == items.ITEM_BANANA:
|
||||
self.speed_max += 1
|
||||
self.speed_max += 0.01
|
||||
elif item.kind == items.ITEM_BANANA:
|
||||
self.speed_max -= 1
|
||||
self.speed_max -= 0.01
|
||||
|
||||
self.speed_max = clamp(self.speed_max, 0, 100)
|
||||
|
||||
Reference in New Issue
Block a user