News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

Map animations

Started by Kman1011, January 21, 2007, 08:13:06 PM

Previous topic - Next topic

Kman1011

I'm have a difficult time with map animations.

I can't get my blocks to animate. I used every single animation command there is in my test demo. I'm wondering if there is a certain order in which these commands have to be.

LoadImage "face.bmp",1
Cls 0
CreateMap 1,1
CreateLevel 1,1,6,6
MakeMapGFX 1,1,64,64,20,0
PokeLevelTile 1,1,0,0,$8000001
PokeLevelTile 1,1,6,6,$8000001
CreateMapAnim 1,1,1
MapAnimFrameRate 1,1,20
LevelAnimated 1,1
MapAnimQuantity 1,1
MapAnimType 1,1,1
For i=0 To 9
PokeMapAnim 1,1,i,i
Next i
Do
UpdateMapAnims 1
DrawMap 1,1,0,0

Sync
Loop
WaitKey


This can be frustrating to say the least >:(

Ahh... Another visitor. Stay awhile....STAY FOREVER!!!...MWA-HA-HA-HA

Kman1011

OK. I'm not sure i understand this

QuoteNote: When play basic draws a level, it distinguishes between normal tiles and animated tiles by the sign of the value. Normal tile indexes should be stored as positives values (from 0 to the number of tiles this map has), while animations require you to add on the sign bit. You can do this two ways by simply adding on the hex value $8000000 to your animation indexes or by multiplying them by -1 when you poke them in.

I.e. Poking a animation index into a level.

  pokeMapTile MyMap,MyLevel,TileXpos,TileYpos, MyAnimation + $8000000


OK... So i do this

LoadImage "face.bmp",1
Cls 0
CreateMap 1,1
MakeMapGFX 1,1,64,64,20,0
MapAnimQuantity 1,1
CreateMapAnim 1,1,10
For i=0 To 10
PokeMapAnim 1,1,i,i
Next i
MapAnimFrameRate 1,1,40
MapAnimType 1,1,0
CreateLevel 1,1,6,6

PokeLevelTile 1,1,0,0,1+$8000000
PokeLevelTile 1,1,6,6,1+$8000000

LevelTransparent 1,1,11
LevelAnimated 1,1

Do
DrawMap 1,1,0,0
UpdateMapAnims 1
Sync
Loop


Again..... NOTHING!!! ???

I have seen in examples  written - $80000001. But that is not $8000000 +1....is it??. How can there still be six zeros there??

Quoteor by multiplying them by -1

Alright-

PokeLevelTile 1,1,0,0,1*-1
PokeLevelTile 1,1,6,6,1*-1


nope still nothing!!

I give up. What is $80000001=?






Ahh... Another visitor. Stay awhile....STAY FOREVER!!!...MWA-HA-HA-HA

kevin

#2
 There were two problems with your code.

  1)  You'd set your anim to IDLE.. In this state it doesn't animate !
  2) The Animated bit mask was wrong.  It's $80000000... although it appears to be wrong in the Doc's also :((.   I'll correct that now !   




LoadImage "face.bmp",1
Cls 0
CreateMap 1,1
MakeMapGFX 1,1,64,64,20,0
MapAnimQuantity 1,1
CreateMapAnim 1,1,10
For i=0 To 10
PokeMapAnim 1,1,i,i
Next i
MapAnimFrameRate 1,1,5
MapAnimType 1,1,PBMapANim_forward ;  For Anim Flags see either constants section or help  MapAnimType
CreateLevel 1,1,6,6



PokeLevelTile 1,1,0,0,1+$80000000    ; 
PokeLevelTile 1,1,6,6,1+$80000000

LevelTransparent 1,1,11
LevelAnimated 1,1

Do
DrawMap 1,1,0,0
UpdateMapAnims 1
Sync
Loop
[/quote]