News:

Function Finder  Find all the functions within source code files

Main Menu

Mappy - Layers Update

Started by kevin, April 18, 2006, 01:01:15 AM

Previous topic - Next topic

kevin

Here a bit of a WIP shot of some work i've been doing on the Mappy Library.  This version now supports Mappy's layered tiles.   Which you can see in the picture bellow. There's a few missing tiles as those are animations, which are not supported yet.  But coming.  
 

The Demo code.


; Include the Mappy File Loader  (only support 2D maps)
  #Include "mappy.pba"

MakeBitmapFont 1,$ffffff

; Dimension The Mappy Type Variable to Hodl the information about
; any loaded maps
Dim Mappy As tMappyinfo

Filename$="..\TestMaps\Test.fmp"

Print "Loading File:";Filename$
Sync

; Load the Mappy File in
Result=LoadMappy(Mappy.tMappyInfo,Filename$)


; create a camera,  This camera will attach it self to the screen
; by default
CreateCamera 1

; CameraCls 1,Off
cameraclscolour 1,255
Do
; Tell PB to Start capture GFX item to the scene buffer
 CaptureToScene

; Clear the buffer
 ClsScene

; draw Layer 1, and all 4 layers of it at
 DrawMappyLayer(Mappy.tMappyINfo,1,%1111,0,0,0)

; draw the section of the world the camera sees
 DrawCamera 1

; Poll the arrow keys and move the camera is a key is pressed
 If DownKey() Then MoveCamera 1,0,2    
 If UpKey() Then MoveCamera 1,0,-2  
 If LeftKey() Then MoveCamera 1,-2,0    
 If RightKey() Then MoveCamera 1,2,0  

; Show the Basic info about the Map
 Gosub Show_Map_info

; Refresh the Screen for the viewer can see it
 Sync
Loop





Show_Map_info:

If SpaceKey()
 SetCursor 0,0
; Display Map File info
 Print "PP Map:"+Str$(Mappy.PBmap)
 Print Mappy.Authorname$
 Print Mappy.Version
 Print Mappy.Revision
 Print Mappy.Layer.Width
 Print Mappy.Layer.Height
 Print Mappy.Block.width
 Print Mappy.Block.height
 Print Mappy.File_size
EndIf

Return


thaaks

Oooh, that's nice.
Is the Mappy map loaded into a PlayBasic map? Or is it just loading the binary data and being able to draw it on the screen?

I think it would make sense to "convert" the Mappy map during load into a PB map to get the advantage of all the map/layer features PB offers (also collision stuff).

Is that happening in the back or not happening at all?

Cheers,
Tommy

Ian Price

I came. I saw. I played some Nintendo.

kevin

QuoteOooh, that's nice.
Is the Mappy map loaded into a PlayBasic map? Or is it just loading the binary data and being able to draw it on the screen?

Of course.  But the formats are not the same so some Mappy features don't really translate.

thaaks

QuoteOf course.  But the formats are not the same so some Mappy features don't really translate.
How could I dare to doubt  :P
Is the mappy.pba in the 1.31 Release of PB or do your work on an improved version?

I just had a quick look at Mappy: is your mappy.pba limited to standard 2D maps or does it also support iso and hex maps (is that possible with the PB maps?)?

Must have a look at this - I have a nearly finished game waiting on my hard disk that I could port to PB using the Mappy or the PlayBasic builtin map stuff - whatever is easier to use  :rolleyes:

Is there a list or chart of what features of Mappy are supported in some way?

Kevin, do you think it does make sense to improve your "Mappy support library" to get rid of your own map editor? Would take some workload from your shoulders, right?

kevin

QuoteIs the mappy.pba in the 1.31 Release of PB or do your work on an improved version?

 I'm just updating the existing one (which has been part of PB release for a while), The update will be in the new version.  Te version in V1.31 installer is a bit different to older and the newer interface.  But ya get that :)


QuoteI just had a quick look at Mappy: is your mappy.pba limited to standard 2D maps or does it also support iso and hex maps (is that possible with the PB maps?)?

 No idea.. Although I can't recall anything in the format for either.  So since it's supports layers now, it might be possible.


QuoteIs there a list or chart of what features of Mappy are supported in some way?

  No

QuoteKevin, do you think it does make sense to improve your "Mappy support library" to get rid of your own map editor? Would take some workload from your shoulders, right?

 Possibly...

kevin

Basic Animation support is in.   Although it doesn't support the animation settings. That's the next little tidbit.

Fash

For PC game/demo music visit
Future Developments

thaaks

Yes, nice progress.
Animation settings describe the speed of frame changes and which block graphics to use, right?

Just had a look at the Mappy example in the projects\demos\mappy directory.
Right now the sample code is broken (you changed the types, now including a tMappyBlock type to describe the blocks). But don't bother, I'm waiting for the next release  :D

Kevin, I'm wondering how many things you can work on in parallel - sometimes I'm convinced you're doing polyphasic sleep and get 21 working hours and 6 naps a day half an hour each...  :rolleyes:

kevin

QuoteAnimation settings describe the speed of frame changes and which block graphics to use, right?

 Animate speeds are  in _frames_  So a rate of 1, means it's changes frames every update,  a rate f 2, every second etc.

QuoteJust had a look at the Mappy example in the projects\demos\mappy directory.
Right now the sample code is broken (you changed the types, now including a tMappyBlock type to describe the blocks). But don't bother, I'm waiting for the next release 

 Yeah the old examples won't work with the newer revision. The older examples have been replaced.  Most Slibs have an examples folder now also.  Including  mappy.  The examples in this case just load different types of test maps.  But most people should know it exists this tie around.

QuoteKevin, I'm wondering how many things you can work on in parallel - sometimes I'm convinced you're doing polyphasic sleep and get 21 working hours and 6 naps a day half an hour each...

 And here i was thinking i'd been taking it pretty easy lately..   :)

thaaks

QuoteMost Slibs have an examples folder now also.  Including  mappy.  The examples in this case just load different types of test maps.  But most people should know it exists this tie around.
Huh? What? Where? Why did nobody tell me?
No, honestly I did not find an examples folder except the one mentioned above.
Some hint?
QuoteAnd here i was thinking i'd been taking it pretty easy lately..   :)
And here I am thinking you are either a coding machine or understating  :D
Whatever it is, I love all this progress. I just wish I would be as fast as this...

Cheers,
Tommy

kevin

#11
QuoteHuh? What? Where? Why did nobody tell me?
No, honestly I did not find an examples folder except the one mentioned above.
Some hint? 

Well, you have the PB1.089 example pack (or older even)   I on the other hand have the PBv1.3x example pack.  Which is why i've been working on this .. :)

Fash

Is the new example pack due for release any time soon as there seems to be a few of the older examples not compiling correctly in 1.31 ?
Steve
For PC game/demo music visit
Future Developments

kevin

Prolly with the new demo.  

 I guess I could include the current state with the next patch though

Fash

QuoteProlly with the new demo.  

  I guess I could include the current state with the next patch though
Would be a great idea...Look forward to it :)
For PC game/demo music visit
Future Developments