ID:1971430
 
Currently working on something, I say something because idk what am doing :B .

/*
*/

//TESTING
mob/verb/Test()
var/map/map = new/map(100) //Generates a 100x100 Virtual Map
map.addObject(src,rand(1,map.maxx),rand(1,map.maxy),FALSE)
map.game_started = TRUE
/*
*/


atom/movable/var/tmp
map/map
tile/tile

mob/Move(_ignore_,direction)
if(!map || !src.tile || !map.game_started)
return FALSE
var/tile/tile
switch(direction)
if(NORTH) tile = src.tile.north
if(SOUTH) tile = src.tile.south
if(EAST) tile = src.tile.east
if(WEST) tile = src.tile.west
if(!tile)return FALSE
src.tile.onRem(src)
src.tile = tile
src.tile.onAdd(src)

map
var
maxx = 0
maxy = 0
max_size= 100
size = 0
list/grid[] //The map.
list/objects[] //Objects within the map.
game_started = FALSE
gamemode = "Free-for-all"
New(size=1)
grid = list()
objects = list()
if(generateMap(size))
return TRUE
proc
addObject(atom/movable/object,xPos=1,yPos=1,clone=FALSE)
if(!clone && objects.Find(object))
return FALSE
objects |= object
if(xPos>maxx) xPos = maxx
if(yPos>maxy) yPos = maxy
var/tile/tile = grid["[xPos],[yPos]"]
if(!tile) return FALSE
object.map = src
object.tile = tile
tile.onAdd(object)
return TRUE
generateMap(size=3)
if(size>max_size) size = 100
for(var/Y = 1 to size)
for(var/X = 1 to size)
grid["[X],[Y]"] = new/tile(X,Y)
var/tile/tile
for(var/id in grid)
tile = grid[id]
tile.north = grid["[tile.x],[tile.y+1]"]
tile.south = grid["[tile.x],[tile.y-1]"]
tile.east = grid["[tile.x+1],[tile.y]"]
tile.west = grid["[tile.x-1],[tile.y]"]
maxx = size
maxy = size
return TRUE

tile
var
x = 0
y = 0
tmp/tile
north = null
south = null
east = null
west = null
tmp/list
container[]
New(X,Y)
container = list()
x = X
y = Y
proc
onAdd(object)
world << "[object] was added! loc = ([x],[y])"
return TRUE
onRem(object)
return TRUE
Added in AI and the ability for them to wander.



map/var/list/AI[]

mob/proc/Wander()
src.Move(null,pick(list(1,2,4,8)))

map/proc/addAI()
var/mob/mob = new/mob{name="Enemy"}
addObject(mob,rand(1,maxx),rand(1,maxy),TRUE)
AI += mob
return TRUE
Generating a 300x300 map creating 90000 tiles.

Finally found a game idea, Horror- players vs player.
The inspiration was lummox for making Scream of the Stickster, it deserves more justice.

Created a library that is an efficient and easy to use.
Allows you to que procs inside of a global loop allowing for quick and easy procs that need to be called a few times or for forever.

http://www.byond.com/developer/Kozuma3/kHooks?tab=index
I'm currently hosting a very early stage of the project, interested in joining? byond://135.26.190.189:21022