-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbullet.py
30 lines (24 loc) · 866 Bytes
/
bullet.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#----------------------------------------------------------------------
# Author:
# Bruno Dilly <[email protected]>
#
# Copyright (C) 2008 Bruno Dilly
#
# Released under GNU GPL, read the file 'COPYING' for more information
# ---------------------------------------------------------------------
import pygame
from game_entity import GameEntity
from vector import Vector
BULLET_SPEED = 0.5
class Bullet(GameEntity):
def __init__(self, world, image, location, destination):
GameEntity.__init__(self, world, "bullet", image, location, BULLET_SPEED)
self.destination = destination
def act(self, time_passed):
GameEntity.act(self, time_passed)
if self.location == self.destination:
self.destroy()
return
self.world.test_colision(self)