提交 2523ed5f 编写于 作者: 生产队的小刘's avatar 生产队的小刘 😁

上传新文件

上级 75455283
from utility import *
import pygame,random
vec = pygame.math.Vector2
class Particle:
"base class for all particles"
def __init__(self,main,x,y):
pass
def update_position(self):
self.acc("y",10)
self.velocity += self.acceleration
self.position += self.velocity*self.main.dt
def draw(self):
pygame.draw.circle(self.main.screen,RED,(int(self.position.x),int(self.position.y)),1)
def acc(self,dir,val):
if dir == "x":
self.velocity.x += val
if dir == "y":
self.velocity.y += val
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册