Latest UploadsPlatdude SpottingJayenkaiNom nom nomJayenkaiRainbow TroutPakzKing SalmonPakzSnookerJayenkaiYou've ... o have youJayenkai
 Code Snippets > Generators ( Created 11 December 2016 | Last Edited 11 December 2016)

 Maze 2d - Recursive Backtracker by Pakz | No VotesMonkey 2 maze generator - tilemap Written inOther Here the emscripten page on my homepage. (note on tablets/phones there might be problems.) cromdesi.home.xs4all.nl/emscripten/maze/Untitled1.html Here the monkey 2 code: #Import "" #Import "" Using std.. Using mojo.. Class maze Field sw:Int,sh:Int Field mw:Int,mh:Int Field tmw:Int,tmh:Int Field tw:Float,th:Float Field mazex:Stack = New Stack Field mazey:Stack = New Stack Field tilemap:Int[,] = New Int[1,1] Field map:Int[,] = New Int[1,1] Field map2:Int[,,] = New Int[1,1,1] Enum wall up=1, right=2, down=3, left=4 End Enum Method New(sw:int,sh:Int,mw:Int,mh:Int) Self.sw = sw Self.sh = sh Self.mw = mw Self.mh = mh tmw = (mw*2)+1 tmh = (mh*2)+1 tw = Float(sw)/((Float(tmw))) th = Float(sh)/((Float(tmh))) tilemap = New Int[mw*3,mh*3] map = New Int[mw,mh] map2 = New Int[mw,mh,4] makemaze() End Method Method makemaze() Local ax:Int[] = New Int[](0,1,0,-1) Local ay:Int[] = New Int[](-1,0,1,0) mazex.Push(Rnd(mw)) mazey.Push(Rnd(mh)) While mazex.Empty = False Local x:Int=mazex.Top Local y:Int=mazey.Top Local d:Int[] = New Int[4] Local deadend:Bool=True For Local i:=0 Until ax.Length Local x2:Int=x+ax[i] Local y2:Int=y+ay[i] If x2>=0 And x2=0 And y2500 Then cnt=0 SeedRnd(Millisecs()) Local s:Int=Rnd(10,64) mymaze = New maze(Width,Height,s,s) End If ' mymaze.draw(canvas) ' canvas.Color = Color.White canvas.DrawText("Press space or tap for new maze",0,0) ' if key escape then quit If Keyboard.KeyReleased(Key.Escape) Then App.Terminate() End Method End Class Function Main() New AppInstance New MyWindow App.Run() End Function -->

There are no comments for this entry. -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 660|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
 Latest PostsJeremy Bloody Kyle steve_ancell Mon 09:45 GamerBlock Jayenkai Mon 09:06 Laptop Aaargh... Jayenkai Mon 07:06 Changing Thumbnail Sizes Jayenkai Mon 05:27 Technology on Planes therevillsgames Sat 17:00 London Car/Stab Incident steve_ancell Sat 12:10 A New Korg Gadget! Jayenkai Sat 04:53 Happy Birthday, Spinal Jayenkai Fri 08:40 Watch Switch - Fitbit Blaze rockford Fri 03:52 Happy Birthday Evil Roy Ferguson rockford Wed 16:21 More

 Latest Items Blog : My Arduino experience.steve_ancell Fri 13:45 Snippet : Skylinesspinal Fri 06:13 Showcase : Infinitronrychan Tue 03:02 Dev-Diary : PS2 to N64 Adapterspinal Sun 10:49 Link : Vector Tutorials/Help page.Pakz Thu 23:00 Blog : mini projectspinal Sun 10:13 Showcase : Blockman ReturnsJayenkai Fri 03:04 Snippet : Wall Tracing on Random Maps (rpg)rskgames Wed 22:48 Snippet : Path FollowingPakz Mon 16:25 Snippet : Flowers (Jan 2017)Kuron Thu 01:13 Showcase : Clusters of Hextherevillsgames Mon 15:01 Article : Maths 101 - Episode 1: Basic Trigonometryshroom_monk Sun 14:07 Article : Maths 101 - Episode 5: Line Intersectionshroom_monk Sun 14:02 Dev-Diary : Normals and Dot productsPakz Sat 20:37 Pets : Molly On The CouchJayenkai Thu 04:32More

Who's Online
Jayenkai
Mon, at 11:47
spinal
Mon, at 11:26
Pakz
Mon, at 11:19
steve_ancell
Mon, at 10:52
Andy_A
Mon, at 09:02
rychan
Mon, at 08:51
rskgames
Mon, at 03:32
rockford
Mon, at 03:19
Krakatomato
Mon, at 02:11
Cower
Mon, at 00:18