Thrown in for good measure is the original Maze Keeper Editor, now renamed as Grid.
Screenshot:
Download:
Maze Keeper Editor
Code:
Remstart *****************************
Maze Keeper Map Editor
Revised Version
Josh Mooney 2009
******************************* Remend
Rem Setup Screen *********************
Set Display Mode 1024,768,16
Sync Rate 0 : Sync On : Sync Rate 30
Set Window On : Set Window Layout 1,1,4
Set Window Title "Maze Keeper Map Editor [Version:0.05] Josh Mooney 2009"
Autocam Off : Hide Mouse
Rem Setup Variables ******************
Rem Camera Variables *****************
Zoom# = 100
Rem Tile/Object Type *****************
Type Stats
Name as String
Object as Integer
EndType
Rem Wall Tile Array ******************
Tiles# = 3
Tile_Select# = 1
Dim Tile(3) as Stats
Rem Map Array ************************
Type Mstats
LayerA As Integer
LayerB As Integer
Object As Integer
Model As Integer
Angle As Integer
EndType
Dim Map(100,100) As Mstats
For A = 1 to 100
For B = 1 to 100
Map(A,B).LayerA = 0
Map(A,B).LayerB = 0
Map(A,B).Object = 0
Map(A,B).Model = 0
Map(A,B).Angle = 0
Next B
Next A
Rem Editor Tile Mode *****************
Mode# = 1
Rem Spam Key *************************
Spam# = 0
Rem Load Editor Images ***************
Load Image "HUD/hud_main.png",1,1
Load Image "HUD/grid1.png",2,1
Rem Load Editor Objects **************
Rem Cursor Object ********************
Load Object "HUD/cursor.x",1
Load Image "HUD/cursor.png",10,1
Texture Object 1,10 : Set Object Transparency 1,1
Position Object 1,0,2,0 : Set Object Light 1,10
Disable Object ZDepth 1
Rem Cursor 2nd Object ****************
Load Object "HUD/cursor2.x",11
Load Image "HUD/cursor2.png",11,1
Texture Object 11,11 : Set Object Transparency 11,1
Position Object 11,0,2,0 : Set Object Light 11,10
Rem Skysphere Object *****************
Load Object "HUD/skysphere.x",2
Position Object 2,0,0,0 : Scale Object 2,-40000,-40000,-40000
Set Object Light 2,20 : XRotate Object 2,180
Rem Hud Object 001 *******************
Make Object Plane 10,8,6 : Texture Object 10,1
Set Object Transparency 10,1
Set Object Light 10,100
Rem Grid Object **********************
Make Matrix 1,1000,1000,100,100 `replace with grid object
Position Matrix 1,0,0,0
Set Matrix 1,1,0,0,0,0,0,0
Rem Load Wall Tiles ******************
Load Object "Walls/Wall001.x",101
Hide Object 101
Set Object Light 101,1
Tile(1).Name = "Main Wall"
Tile(1).Object = 101
Load Object "Walls/Wall002.x",102
Hide Object 102
Set Object Light 102,1
Tile(1).Name = "Pillar"
Tile(1).Object = 102
Load Object "Walls/Wall003.x",103
Hide Object 103
Set Object Light 103,1
Tile(1).Name = "Slanted Wall"
Tile(1).Object = 103
Rem Setup HUD ************************
Lock Object On 10 : Position Object 10,0,-12,30
Scale Object 10,225,225,225
Rem Setup Scene **********************
Backdrop On : Color Backdrop 0
Rem Main Program Loop ****************
Do
Rem Input Device Test *****************[remove]
Set Cursor 0,0
print "intx: ";CursorX
print "intz: ";CursorZ
print "aryx: ";ArrayX
print "aryz: ";ArrayZ
print "tile select: ";Tile_Select#
remstart
print "joystick x "+str$(joystick x())
print "joystick y "+str$(joystick y())
print "joystick z "+str$(joystick z())
print "joystick up "+str$(joystick up())
print "joystick down "+str$(joystick down())
print "joystick left "+str$(joystick left())
print "joystick right "+str$(joystick right())
print "joystick fire a "+str$(joystick fire a())
print "joystick fire b "+str$(joystick fire b())
print "joystick fire c "+str$(joystick fire c())
print "joystick fire d "+str$(joystick fire d())
print "joystick fire 4 "+str$(joystick fire x(4))
print "joystick fire 5 "+str$(joystick fire x(5))
print "joystick fire 6 "+str$(joystick fire x(6))
print "joystick fire 7 "+str$(joystick fire x(7))
print "joystick fire 8 "+str$(joystick fire x(8))
print "joystick fire 9 "+str$(joystick fire x(9))
print "joystick slider a "+str$(joystick slider a())
print "joystick slider b "+str$(joystick slider b())
print "joystick slider c "+str$(joystick slider c())
print "joystick slider d "+str$(joystick slider d())
print "joystick twist x "+str$(joystick twist x())
print "joystick twist y "+str$(joystick twist y())
print "joystick twist z "+str$(joystick twist z())
print "joystick hat angle(0)"+str$(joystick hat angle(0))
print "joystick hat angle(1)"+str$(joystick hat angle(1))
print "joystick hat angle(2)"+str$(joystick hat angle(2))
print "joystick hat angle(3)"+str$(joystick hat angle(3))
remend
Rem Gosubs ***************************
Gosub Left_Joystick
Gosub Right_Joystick
Gosub Camera_Control
Gosub Hud_Control
Gosub Obj_Placement
Sync
Loop
Rem Tile Placement Code **************
Obj_Placement:
Rem Get Array Position ***************
CursorX = (floor((object position x(1)/10))*10)+10
CursorZ = (floor((object position z(1)/10))*10)+10
ArrayX = CursorX/10
ArrayZ = CursorZ/10
Rem Place Tile ***********************
If Mode# = 1
If Joystick Fire B() = 1
For objcheck = 1 to 1000
If Object Exist(objcheck+500) = 0
If Map(ArrayX,ArrayZ).Object = 0
Map(ArrayX,ArrayZ).Object = objcheck+500
Map(ArrayX,ArrayZ).Model = SelectA
Map(ArrayX,ArrayZ).LayerA = 1
Clone Object objcheck+500,selectA+100
Position Object objcheck+500,CursorX-5,0,CursorZ-5
Scale Object objcheck+500,100,100,100
Rotate Object objcheck+500,0,0,0 : Enable Object ZDepth objcheck+500
Endif
Endif
Next objcheck
Endif
Endif
Rem Rotate Wall **********************
If Mode# = 1
If Joystick Fire A() = 0
spamA = 0
Else
If spamA = 0
If Map(ArrayX,ArrayZ).LayerA > 0
Yrotate Object Map(ArrayX,ArrayZ).Object,Wrapvalue(Object Angle Y(Map(ArrayX,ArrayZ).Object)+90)
Map(ArrayX,ArrayZ).Angle = Object Angle Y(Map(ArrayX,ArrayZ).Object)
spamA = 1
Endif
Endif
Endif
Endif
Rem Delete Wall **********************
If Mode# = 1
If Joystick Fire C() = 1
If Map(ArrayX,ArrayZ).LayerA > 0
Delete Object Map(ArrayX,ArrayZ).Object
Map(ArrayX,ArrayZ).LayerA = 0
Map(ArrayX,ArrayZ).Object = 0
Map(ArrayX,ArrayZ).Model = 0
Endif
Endif
Endif
Rem Return To Main Code **************
Return
Rem Hud Control **********************
Hud_Control:
Rem HUD Reset ************************
Enable Object ZDepth 10
Rem Main Hud *************************
If Mode# = 1 `wall placement mode
Rem Wall Select **********************
If Spam# = 1
If Joystick Hat Angle(0)=-1 Then Spam# = 0
Endif
If Spam# = 0
If Joystick Hat Angle(0)=9000
Tile_Select# = Tile_Select# + 1
If Tile_Select# > Tiles# Then Tile_Select# = 1
Spam# = 1
Endif
If Joystick Hat Angle(0)=27000
Tile_Select# = Tile_Select# - 1
If Tile_Select# < 1 Then Tile_Select# = Tiles#
Spam# = 1
Endif
Endif
Rem Set Selector Objects To walls
selectA = Tile_Select# `selected wall
selectB = Tile_Select#-1 : if selectB < 1 then selectB = Tiles# `previous wall
selectC = Tile_Select#+1 : if selectC > Tiles# then SelectC = 1 `next wall
Rem Reset Objects ********************
Enable Object ZDepth selectA+100
Enable Object ZDepth selectB+100
Enable Object ZDepth selectC+100
Rem Render Selected Objects To Screen
Rem Selected Wall
Lock Object On selectA+100 : Position Object selectA+100,0,-9,20
Show Object selectA+100 : Turn Object Left selectA+100,3
Scale Object selectA+100,25,25,25
Rem Next Wall
Lock Object On selectC+100 : Position Object selectC+100,3.8,-10,20
Show Object selectC+100
Scale Object selectC+100,10,10,10
Rem Previous Wall
Lock Object On selectB+100 : Position Object selectB+100,-3.8,-10,20
Show Object selectB+100
Scale Object selectB+100,10,10,10
Endif
Rem Update Main HUD ******************
Disable Object ZDepth 10
Disable Object ZDepth selectA+100
Disable Object ZDepth selectB+100
Disable Object ZDepth selectC+100
Rem Return to Main Code **************
Return
Rem Left Joystick Code ***************
Left_Joystick:
Rem Move Cursor F/B ******************
If Joystick Y() < -100 `move cursor forward
Move Object 1,0.5
If Joystick Y() < -900
Move Object 1,1
Endif
Endif
If Joystick Y() > 100 `move cursor backward
Move Object 1,-0.5
If Joystick Y() > 900
Move Object 1,-1
Endif
Endif
Rem Strafe Cursor ********************
If Joystick X() < -100 `strafe cursor left
Move Object Left 1,0.5
If Joystick X() < -900
Move Object Left 1,1
Endif
Endif
If Joystick X() > 100 `strafe cursor right
Move Object Right 1,0.5
If Joystick X() > 900
Move Object Right 1,1
Endif
Endif
Rem Update Second Cursor Object ******
Position Object 11,CursorX-5,0,CursorZ-5
Rem Return to Main Loop **************
Return
Rem Right Joystick Code **************
Right_Joystick:
Rem Zoom *****************************
If Joystick Twist Z() < 20000 `zoom in
Inc Zoom#,-1
If Joystick Twist Z() < 1000
Inc Zoom#,-2
Endif
Endif
If Joystick Twist Z() > 45000 `zoom out
Inc Zoom#,1
If Joystick Twist Z() > 55535
Inc Zoom#,2
Endif
Endif
Rem Zoom Limits **********************
If Zoom# < 10 Then Zoom# = 10
If Zoom# > 500 Then Zoom# = 500
Rem Rotate Cursor Object *************
If Joystick Z() < -150 `rotate counter-clockwise
YRotate Object 1,Wrapvalue(Object Angle Y(1)-1)
If Joystick Z() < -950
YRotate Object 1,Wrapvalue(Object Angle Y(1)-2)
Endif
Endif
If Joystick Z() > 150 `rotate clockwise
YRotate Object 1,Wrapvalue(Object Angle Y(1)+1)
If Joystick Z() > 950
YRotate Object 1,Wrapvalue(Object Angle Y(1)+2)
Endif
Endif
Rem Return to Main Loop **************
Return
Rem Camera/Rotation Code *************
Camera_Control:
Set Camera To Follow Object Position X(1),Object Position Y(1),Object Position Z(1),Object Angle Y(1),Zoom#,Zoom#,5,0
Point Camera Object Position X(1),Object Position Y(1),Object Position Z(1)
Position Object 2,Camera Position X(),0,Camera Position Z()
Rem Return to Main loop
Return
Version 0.1 of the Level Editor:
Remstart **************************************
Dungeon Maze Map Editor
Created BY: Josh Mooney 2009
**************************************** Remend
Rem Setup Screen ******************************
Set Display Mode 1440,900,16
rem Set Window On : Set Window Layout 1,1,4
rem Set Window Title "Dungeon Maze Map Editor [V0.1]"
Sync Rate 0: Sync On : Sync Rate 30
Autocam Off : Hide Mouse
Rem Setup Variables ***************************
Rem Map Type Variables
Type MapStats `types for map
Name As String `map name
SizeX As Integer `map's size in x direction
SizeZ As Integer `map's size in z direction
Pallete As String `map tile pallete
Tile as Integer `map tile code
Event as Integer `map event code
ObjectA as Integer `objecta number
ObjectB as Integer `objectb number
Endtype
Dim Map(20,100,100) As MapStats `set map variables to stats
`[max 20 quick saved maps at 100x100]
Rem Setup Default Map
Map(1,1,1).Name = "Default.dmp"
Map(1,1,1).SizeX = 10
Map(1,1,1).SizeZ = 10
Map(1,1,1).Pallete = "Default.plt"
For MapX = 1 to 10
For MapZ = 1 to 10
Map(1,MapX,MapZ).Tile = 0
Next MapZ
Next MapX
Rem Object Type Variables
Type ObjectStats
Name As String `object name
PosX As Float `x cordinate position
PosZ As Float `z cordinate position
StateA As Integer `state of object [conditions based on type]
StateB As Integer `state of object [conditions based on type]
StateC As Integer `state of object [conditions based on type]
EndType
Rem Tile Creator Variables
Dim Tile(1000) as ObjectStats
For a = 1 to 1000
Tile(a).StateA = 0
Next a
Rem Cursor Variables
Dim Cursor(2) as ObjectStats `1=3d 2=2d
Cursor(1).Name = "Selection Cursor"
Cursor(1).PosX = 0
Cursor(1).PosZ = 0
Cursor(1).StateA = 0
Cursor(1).StateB = 0
Cursor(1).StateC = 0
Rem Camera Zoom
Zoom# = 100
Rem Setup Scene *******************************
Backdrop On : Color Backdrop 0 `backdrop settings
Rem Grid
Make Matrix 1,(Map(1,1,1).SizeX)*10,(Map(1,1,1).SizeZ)*10,Map(1,1,1).SizeX,Map(1,1,1).SizeZ `opening grid
Set Matrix 1,1,0,0,0,0,0,0 `setup matrix for grid look ****{{replace graphic
Position Matrix 1,-5,0,-5 `position grid
Rem Cursor
Make Object Cube 1,10 `make cursor object *****************{{replace graphic
Set Object 1,0,1,0 : Color Object 1,RGB(255,0,0) `setup cursor
Position Object 1,Cursor().PosX,5,Cursor().PosZ `position cursor
Rem Camera Object
Make Object Cube 2,1 `make cube object for camera to follow
Set Object 2,0,1,0 : Color Object 2,RGB(0,255,255) `setup cam object
Position Object 2,0,0,0
Rem Load Pallete ***********************[Replace]
Make Object Cube 10,10 : Color Object 10,RGB(255,255,255)
Position Object 10,-10,5,0
Rem Main Engine *******************************
Do
Rem Input Device Test *****************[remove]
Set Cursor 0,0
print "joystick x "+str$(joystick x())
print "joystick y "+str$(joystick y())
print "joystick z "+str$(joystick z())
print "joystick up "+str$(joystick up())
print "joystick down "+str$(joystick down())
print "joystick left "+str$(joystick left())
print "joystick right "+str$(joystick right())
print "joystick fire a "+str$(joystick fire a())
print "joystick fire b "+str$(joystick fire b())
print "joystick fire c "+str$(joystick fire c())
print "joystick fire d "+str$(joystick fire d())
print "joystick fire 4 "+str$(joystick fire x(4))
print "joystick fire 5 "+str$(joystick fire x(5))
print "joystick fire 6 "+str$(joystick fire x(6))
print "joystick fire 7 "+str$(joystick fire x(7))
print "joystick fire 8 "+str$(joystick fire x(8))
print "joystick fire 9 "+str$(joystick fire x(9))
print "joystick slider a "+str$(joystick slider a())
print "joystick slider b "+str$(joystick slider b())
print "joystick slider c "+str$(joystick slider c())
print "joystick slider d "+str$(joystick slider d())
print "joystick twist x "+str$(joystick twist x())
print "joystick twist y "+str$(joystick twist y())
print "joystick twist z "+str$(joystick twist z())
print "joystick hat angle(0)"+str$(joystick hat angle(0))
print "joystick hat angle(1)"+str$(joystick hat angle(1))
print "joystick hat angle(2)"+str$(joystick hat angle(2))
print "joystick hat angle(3)"+str$(joystick hat angle(3))
Rem Other Variables
Print "*************************************"
Print "Map: ";Map(1,1,1).Name
Print "Pallete: ";Map(1,1,1).Pallete
Print "CursorX: ";Object Position X(1)
Print "CursorZ: ";Object Position Z(1)
Print "Cursor StateA: ";Cursor(1).StateA
Print "Cursor StateB: ";Cursor(1).StateB
Rem Control Code ******************************
If Joystick Fire A()= 1
Gosub camera_control
Else
Gosub cursor_control
Endif
Rem Place Object *********************[update]
If Joystick Fire B() = 1
If Map(1,int(Cursor(1).PosX),int(Cursor(1).PosZ)).Tile = 0 `check if tile is empty on map
For TileCheck = 1 to 1000 `check for tile object number
If Tile(TileCheck).StateA = 0 Then ObjectC = TileCheck+100 : Tile(TileCheck).StateA = 1 : Exit
Next TileCheck
Clone Object ObjectC,10 : Position Object ObjectC,Object Position X(1),Object Position Y(1),Object Position Z(1)
Map(1,int(Cursor(1).PosX),int(Cursor(1).PosZ)).ObjectA = ObjectC `set object number to map array
Map(1,int(Cursor(1).PosX),int(Cursor(1).PosZ)).Tile = 1 `set object type to array
Else
`play error sound
Endif
Endif
Rem Remove Object ********************[update]
If Joystick Fire C() = 1
If Map(1,int(Cursor(1).PosX),int(Cursor(1).PosZ)).Tile = 1 `check if tile is filled on map
If Object Exist(Map(1,int(Cursor(1).PosX),int(Cursor(1).PosZ)).ObjectA) = 1
Delete Object Map(1,int(Cursor(1).PosX),int(Cursor(1).PosZ)).ObjectA `delete object
Map(1,int(Cursor(1).PosX),int(Cursor(1).PosZ)).Tile = 0 `reset tile array
Endif
Else
`play error sound
Endif
Endif
Rem Exit Program **********************[update]
If Joystick Fire X(9) = 1 Then End
Rem Camera Control ****************************
Set Camera To Follow Object Position X(2),Object Position Y(2),Object Position Z(2),0,Zoom#,Zoom#,5,0
Point Camera Object Position X(2),Object Position Y(2)+5,Object Position Z(2)
Rem Camera Zoom *****************************
If Joystick Twist Z() < 22767 `zoom in
Zoom# = Zoom# - 1
If Joystick Twist Z() < 1000
Zoom# = Zoom# - 4
Endif
Endif
If Joystick Twist Z() > 42767 `zoom out
Zoom# = Zoom# + 1
If Joystick Twist Z() > 55535
Zoom# = Zoom# + 4
Endif
Endif
If Zoom# < 10 Then Zoom# = 10 `check zoom range
If Zoom# > 1000 Then Zoom# = 1000
Sync
Loop
Rem Cursor Code *******************************
cursor_control:
Rem Cursor Stat Update
Cursor(1).PosX = (Object Position X(1)+10)/10
Cursor(1).PosZ = (Object Position Z(1)+10)/10
If Joystick X() < 300
If Joystick X() > -300
Cursor(1).StateA = 0 `reset cursorx state if at rest
Endif
Endif
If Joystick Y() < 300
If Joystick Y() > -300
Cursor(1).StateB = 0 `reset cursory state if at rest
Endif
Endif
Rem Movement X Position ***********************
If Joystick X()>300 `check joystick move in x
If Joystick x()>950 `continues movement
If Object Position X(1) < ((Map(1,1,1).SizeX)*10)-10 Then Move Object Right 1,10
Else `step movement
If Cursor(1).StateA = 0
If Object Position X(1) < ((Map(1,1,1).SizeX)*10)-10 Then Move Object Right 1,10
Cursor(1).StateA = 1
Endif
Endif
Endif
If Joystick X()<-300 `check joystick move in x
If Joystick x()<-950 `continues movement
If Object Position X(1) > 0 Then Move Object Left 1,10
Else `step movement
If Cursor(1).StateA = 0
If Object Position X(1) > 0 Then Move Object Left 1,10
Cursor(1).StateA = 1
Endif
Endif
Endif
Rem Movement Z Position ***********************
If Joystick Y()>300 `check joystick move in y
If Joystick Y()>950 `continues movement
If Object Position Z(1) > 0 Then Move Object 1,-10
Else `step movement
If Cursor(1).StateB = 0
If Object Position Z(1) > 0 Then Move Object 1,-10
Cursor(1).StateB = 1
Endif
Endif
Endif
If Joystick Y()<-300 `check joystick move in y
If Joystick Y()<-950 `continues movement
If Object Position Z(1) < ((Map(1,1,1).SizeZ)*10)-10 Then Move Object 1,10
Else `step movement
If Cursor(1).StateB = 0
If Object Position Z(1) < ((Map(1,1,1).SizeZ)*10)-10 Then Move Object 1,10
Cursor(1).StateB = 1
Endif
Endif
Endif
Rem Return to main loop
Return
Rem camera control ***************************
camera_control:
Rem Set camera to cursor position *************
If Joystick Hat Angle(0) = 0
Position Object 2,Object Position X(1),Object Position Y(1),Object Position Z(1)
Endif
Rem Movement X Position ***********************
If Joystick X()>300 `check joystick move in x
Move Object Right 2,1
If Joystick x()>950 `continues movement
Move Object Right 2,2
Endif
Endif
If Joystick X()<-300 `check joystick move in x
Move Object Left 2,1
If Joystick x()<-950 `continues movement
Move Object Left 2,2
Endif
Endif
Rem Movement Z Position ***********************
If Joystick Y()>300 `check joystick move in x
Move Object 2,-1
If Joystick Y()>950 `continues movement
Move Object 2,-2
Endif
Endif
If Joystick Y()<-300 `check joystick move in x
Move Object 2,1
If Joystick Y()<-950 `continues movement
Move Object 2,2
Endif
Endif
Rem Return to main loop
Return
Controls:
-Uses a Gamepad with Joysticks
-Left Joystick: Move Cursor
-Right Joystick: Control Camera
-Button 1: Rotate Object
-Button 2: Place Object
-Button 3: Delete Object
Left/Right D-Pad: Navigate Tile Pieces