Mind.Orientation
Classes, methods and functions marked with * aren’t for usual cases, they are made to help to the rest of the library.
Part of library for maps and points in map.
-
exception Mind.Orientation.MapError(x, y, max_x, max_y)[source]
Exception for points outside the map.*
-
class Mind.Orientation.MAP(width, height)[source]
Bacis map class.
-
add_obj(obj)[source]
Function that adds object(point, rect...) to map.
-
at(x, y)[source]
Return generator of all items in map on x, y coordinates.
-
class Mind.Orientation.point(x, y, Map, description='Unknown', quiet=False)[source]
Basic point class.
-
distance(other)[source]
Calculates distance between this and given point.
-
get_xy()[source]
Returns point’s x and y.
-
class Mind.Orientation.line(points, Map, description='Unknown', quiet=False, from_line_seg=False)[source]
Basic line class.
-
get_angle()[source]
Returns line anlge.
-
class Mind.Orientation.line_seg(points, Map, description='Unknown', quiet=False, from_line=False)[source]
Bacis line segment class.
-
get_angle()[source]
Returns line rotation (0 vertical, 90 horizontal) in range 0 - 180.
-
Mind.Orientation.q_points(x1, y1, x2, y2, Map)[source]
Returns points for line and line_seg.
-
class Mind.Orientation.ray(start_p, some_p, Map, description='Unknown', quiet=False)[source]
Basic ray class.
-
class Mind.Orientation.direction(point, angle, Map, description='Unknown', quiet=False)[source]
Bacis direction class.
-
get_pos(distance)[source]
Gets point of direction with given distance.
-
move(distance)[source]
‘Moves’ directions point.
-
set_angle(angle)[source]
Sets new angle.
-
get_angle()[source]
Returns direction angle.
-
ch_angle(change)[source]
Changes angle for given value.
-
class Mind.Orientation.group_of_points(Map, description='Unknown', *points, quiet=False)[source]
Class for group of points.
-
at(x, y)[source]
Return generator of all items in group on x, y coordinates.
-
class Mind.Orientation.rect(x, y, width, height, Map, description='Unknown', quiet=False)[source]
Bacis map rect class.
-
at(x, y)[source]
Test if point is in rect.*
-
collide(other)[source]
Tests colliding with given rect.
-
touch(other)[source]
Tests touching with other rect.
-
class Mind.Orientation.ext_obj(obj, *args, **kwargs)[source]
Extended object class.
-
class Mind.Orientation.tiled_map(name, r_decoder={'p': <class 'Mind.Orientation.point'>}, a_decoder={'P': <class 'Mind.Orientation.point'>})[source]
Class for map in tiled.
-
set_screen(screen)[source]
Sets screen (pygame) on which will map be blited.
-
set_camera_pos(x, y, edge=True)[source]
Sets camera position (centre), if edge is True it won’t be
outside the map.
-
get_camera_pos()[source]
Returns camera position.
-
blit()[source]
Blits map (on seted screen).
-
set_edge(width, height)[source]
Sets edge of map.
-
offset(x, y)[source]
Sets how off map is.
-
class Mind.Orientation.map_obj(x, y, Map, picture, name='Unknown')[source]
Basic Map object.
-
blit()[source]
Blits object picture on Map screen.*
-
get_blit()[source]
Returns position on which picture would be blitted
-
set_position(x, y)[source]
Sets position of object.
-
move(x, y)[source]
Moves objetct.
-
class Mind.Orientation.moving_map(name, x, y, screen, edge=True, decoder={'p': <class 'Mind.Orientation.point'>})[source]
Map in which moving is very easy.
-
set_position(x, y)[source]
Sets position of map ‘center object’.
-
get_position()[source]
Returns ‘center object’ position.
-
move(x, y)[source]
Moves ‘center object’.
Warning
tiled_map and classes after will be initialized only if tiledtmxloader can be initialized!