Docs > Class > Object
Object class
parent: abc.ABC
Constructor
Object() -> Object.
Fixing
- Static method Object.Force_to(): error in instance and extend in child.
- Abstraction method force_to(): error in instance and extend in child.
Should not use them now.
Abstraction Method
- Force()
Force(force) -> Object, add force to object.
- update()
update(timeload=0.06) -> None, update object.
Class Method
- set_name()
set_name(name) -> Object, set the name of object.
- add_tag()
add_tag(tag) -> Object, add a tag to object.
- del_tag()
del_tag(tag) -> Object, remove a tag of object.
- get_force()
get_force() -> Vector, return the force of object, similar with property force.
- add_friction()
add_friction(friction: Friction) -> Object, add the friction to object.
- check_collision()
check_collision(*objects_list) -> list[_Object], return a list of object which collide with self.
Properties
- surface
The showing of object.
- size
The size, unit metres (m) for each element.
- mass
The mass, unit kilogram (kg).
- force
The force, unit Newton (N), showing under type Vector.
- velocity
The velocity, unit metres/second (m/s), showing under type Vector.
- acceleration
The acceleration, unit metres/second**2 (m/s2), showing under type Vector.
- position
The position of object, showing under type Vector.
- name
The name of object, can't be same at other object.
- tags
The list of tags of object.
- running
The status of object, set to True when call Constructor, used in while loop of game.
Can set this property.
- has_collision
Fixing property by the error of force_to() and Object.Force_to().
- friction
The value of friction.
Static Constaint Variables
- INFINITY_MASS
Return the infinity value of mass.