In my recent game jam entry, I found myself doing a lot of overrides to New() to allow easy creation of atoms off the turf grid. --I believe that 490 should have implemented a coordinate datum, which should have x and y values in absolute coordinates and integer z coordinate, and pseudo-variables that allow you to extract tile_x, tile_y, step_x, and step_y values from them.
This would facilitate the following:
* Overhaul New() to natively take a /coord *or* an atom as a loc argument, and simplify the process of doing pixel movement quite a lot.
* movable.Move(coord,Dir), to move to a location and face a specific direction.
* bounds(coord,w,h), obounds(coord,w,h)
* bounds(coords,coords) //grabs all objects overlapping two points
* get_step(coord,dir) //returns turf
* oview/range/hearers/viewers(dist,coord) //boils coords into tiles
* movable.loc = coord shorthand
* atom.coord(anchor), where anchor is 0..15, SOUTHWEST = bottom left corner, NORTHEAST = top right corner, EAST|WEST, NORTH|SOUTH, 0 = center, returns new coordinate of specified bounds anchor point.
* get_dir(coord | atom, coord | atom) //manhattan direction
* get_direction(coord | atom, coord | atom) //direction along 22.5 degree arc sections
* get_dist(coord | atom, coord | atom) //manhattan distance
* get_distance(coord | atom, coord | atom) //pythagorean distance
* bounds_dist(ref, coord | atom) //manhattan bounds distance
* bounds_distance(coord | atom, coord | atom) //pythagorean bounds distance
* get_angle(coord | atom, coord | atom) //arctan dx, dy shorthand
* locate(coords) //grabs the turf at point
* block(coords,coords) //grabs all turfs between two points
Coord should have at least the following methods:
Step(dir,dist)
Step(ang=0,dist)
Clamp(x=1,w=world_max_abs_x,h=1,h=world_max_abs_y)
getStep(dir,dist) //returns new coord
getStep(ang=0,dist) //returns new coord
getClamped(x=1,w=world_max_abs_x,h=1,h=world_max_abs_y) //returns new coord
Locate() //returns turf
Bounds(x,y,w,h) //similar to bounds() function
coords would be 1-indexed to match bounds(), but the default Move() override would subtract 1 automatically from them when used.
See my megathread in Design Philosophy:
https://www.byond.com/forum/post/2860395
ID:2860399
Mar 18 2023, 12:45 am (Edited on Mar 18 2023, 1:28 am)
|
|||||||
Resolved
| |||||||
Dec 18 2024, 9:56 pm
|
|
Lummox JR resolved issue with message:
|