Arkanoid Editor
Blitz3D Forums/Blitz3D Beginners Area/Arkanoid Editor
| ||
I am making an Arkanoid clone and I have everything set up except for the whole brick part. I was wondering how to create a simple editor type thing that will allow me to place certain coloured and different type of bricks to make my own levels. I am sure it would involve alot of For loops? I would also like to know how would I save something like that? Would I make a .dat file with the coordinates of the bricks? -Thanks |
| ||
The easiest way is just to use DATA statements as a poor man's editor, like:; Key: ; 0 = space ; 1 = red block ; 2 = blue block ; 3 = unbreakable block ; etc. .level1 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0 DATA 0,1,1,1,1,1,1,1,1,1,1,1,0 DATA 0,2,2,2,2,2,2,2,2,2,2,2,0 DATA 0,3,3,3,3,0,0,0,3,3,3,3,0 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0 . . . It may be better to use DATA strings if you have loads of different block types etc. Not ideal but it's a start. ;) |
| ||
Check out this free map editor: http://www.blitzbase.de/_mapeditor I believe that it will be available soon. (I am currently helping translate the website to english.) |
| ||
also this one |
| ||
I think I will do the Data thing. I have images as the bricks, how do I assign an image to a number and how do I make the spaces a certain length and stuff? |
| ||
Use Arrays, like this :; Title AppTitle "Data Map" ; Use These Images ; Or Download Here :D ; Graphics Mode Graphics 640,480,16,2 SetBuffer BackBuffer() ; Render Tweening Const UPS=60 period=1000/UPS time=MilliSecs()-period ; Load Images Dim brick(3) For x = 0 To 3 ; I Got This Load Array Thing From "Ross C" Some Year Ago, I Like It Alot! :D brick(x) = LoadImage("Brick "+x+".Png") Next ; Read Data Map Dim map(9,9) For y = 0 To 9 : For x = 0 To 9 Read map(x,y) : Next : Next ; Main Program While KeyHit(1) = False ; Render Tweening Repeat elapsed=MilliSecs()-time Until elapsed ticks=elapsed/period tween#=Float(elapsed Mod period)/Float(period) ; Draw Map For y = 0 To 9 : For x = 0 To 9 If map(x,y) < 4 Then ; The brick(map(x,y)) Might Be A Bit Confusing, But Its All Arrays ;) DrawImage brick(map(x,y)), x * 9 + 275, y * 9 + 195 ; The x * 9 Makes Draws Them In A "Grid" ; And The + 275|195 Makes It Draw The Map *Centered* EndIf Next : Next ; Draw Screen Flip Cls ; Program End Wend ; Free Stuff for x = 0 to 3 : freeimage brick(x) next ; Realy End End ; Data Map ; 0 1 2 3 4 5 6 7 8 9 Data 0, 4, 4, 4, 4, 4, 4, 4, 4, 1 ; A Data 4, 2, 2, 2, 2, 2, 2, 2, 0, 4 ; B Data 4, 3, 4, 4, 1, 1, 4, 4, 0, 4 ; C Data 4, 3, 4, 4, 1, 1, 4, 4, 0, 4 ; D Data 4, 3, 0, 0, 4, 4, 3, 3, 0, 4 ; E Data 4, 3, 0, 0, 4, 4, 3, 3, 0, 4 ; F Data 4, 3, 4, 4, 2, 2, 4, 4, 0, 4 ; G Data 4, 3, 4, 4, 2, 2, 4, 4, 0, 4 ; H Data 4, 3, 1, 1, 1, 1, 1, 1, 1, 4 ; I Data 2, 4, 4, 4, 4, 4, 4, 4, 4, 3 ; J |
| ||
@WolRon: wow.. that looks like a great editor.. do you know anything about the engine? is the drawing speed good etc?! and it said that the file format would be open... that would be a great bonus.. (if the engine works out good though.. :p) |
| ||
Notepad is the best editor :) -1-1-2-2-3-2-3-1-1- 2222222222222222222 3434343434343434343 etc. - empty space 1-4 bricks and you can edit 60 levels/hour :) |
| ||
I have a VERY similar editor where tiles are assigned numbers. These tiles relate to images and specific floor types. The source code was available for download (can't find it right now will post link when i get home!) |
| ||
@LarsG I have a beta version that I am currently messing with. It's very fast with the tests I have done so far (note my system specs though). You should contact MrCredo about it for any more information. |
| ||
I found out today that it (Universal Map Editor) has some awesome parallaxing effects built in as well. |
| ||
Just in passing. There is an old Blitz demo called "Blitzanoid". in the 2D examples, that came with Blitz3D. That may give you some ideas too. |