Changeset 358:911547a1c378


Ignore:
Timestamp:
Sep 6, 2013, 5:39:59 PM (7 years ago)
Author:
Stefano Rivera <stefano@…>
Branch:
default
rebase_source:
7cee601adafa70627c6429b4ae2e2cbcbf12f745
Message:

Kill dead speed limits

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/enemies.py

    r341 r358  
    214214            return
    215215        self.is_moving = True
    216         x_step = 0
    217         y_step = 0
    218         if (target[0] < pos[0]):
    219             x_step = max(-1, target[0] - pos[0])
    220         elif (target[0] > pos[0]):
    221             x_step = min(1, target[0] - pos[0])
    222         if abs(x_step) < 0.5:
    223             x_step = 0
    224         if (target[1] < pos[1]):
    225             y_step = max(-1, target[1] - pos[1])
    226         elif (target[1] > pos[1]):
    227             y_step = min(1, target[1] - pos[1])
    228         if abs(y_step) < 0.5:
    229             y_step = 0
    230         self.set_direction(x_step, y_step)
     216        self.set_direction(target.x - pos.x, target.y - pos.y)
    231217        super(ChargingAlien, self).update(dt)
    232218
Note: See TracChangeset for help on using the changeset viewer.