Commit 8c486e0c authored by Vincent BRULE's avatar Vincent BRULE
Browse files

pas utile

parent c6d51f8e
# -*- coding: utf-8 -*-
# http://pad.univ-nantes.fr/editor/p/g.KMzBqiBBATY1dYss$Ageofdefense
import math
from pygame import *
import time
import os
from carteStruct import *
from constante import Constante
from base import *
from joueur import *
from tour import *
class Projectile:
def __init__(self, dep, arr, v, u):
self.depart = dep
self.arrive = arr
self.vitesse = v
self.unite = u
self.position = dep
def avancer(self, ecran):
x = self.position[0] - self.unite.position[0]
y = self.position[1] - self.unite.position[1]
#pente = y/x
dx = (-1 if x > 0 else 1)
dy = (-1 if x > 0 else 1)
u = self.position[0] + dx
v = self.position[1] + dy
self.position = (u, v)
print self.position
draw.rect(ecran, (255, 0, 0), (u, v, 10, 10))
def detruire(self):
print "detruire"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment