Particle_Simulator/Python_Stuff/world_objects.py

20 lines
730 B
Python
Raw Permalink Normal View History

2024-11-23 21:59:28 -05:00
import numpy as np
from renderer import Player
class particle():
def __init__(self, pos, vel, accel, radius, color, mass, name, renderer, path_to_image):
self.position = np.array(pos, dtype=np.float32)
self.acceleration = np.array(accel, dtype=np.float32)
self.velocity = np.array(vel, dtype=np.float32)
self.radius = radius
self.color = color
self.mass = mass
self.name = name
self.sprite = Player(renderer.sdl_world, renderer, radius, path_to_image, pos[0], pos[1])
class line():
def __init__(self, pos, vector):
self.position = np.array(pos, dtype=np.float32)
self.vector = np.array(vector, dtype=np.float32)