Skip to content

Commit

Permalink
fix feather wind
Browse files Browse the repository at this point in the history
  • Loading branch information
darkcutler committed Jan 28, 2024
1 parent 2f9284f commit b15c5bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Feather.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import math
import cam

import numpy as np
import random
Expand All @@ -12,8 +12,8 @@


class Feather:
def __init__(self, feather_sprites, cam, level):
self.cam = cam
def __init__(self, feather_sprites, _cam, level):
self.cam = _cam
self.level = level
self.feather_sprites = feather_sprites
self.v = np.array([0., 0.])
Expand Down Expand Up @@ -47,7 +47,7 @@ def update_phys(self, dt, fluid):
self.updatePosition(dt)
self.v += (dt * GRAVITY)

x, y = self.cam.worldToGrid(self.pos[0], self.pos[1])
x, y = self.pos[0] / cam.TILE_W, self.pos[1] / cam.TILE_H
v_wind = np.array(fluid.sampleVelocity(x, y))
dv = self.v - v_wind * 1000.0

Expand Down

0 comments on commit b15c5bf

Please sign in to comment.