-
-
Save drakeirving/f49aeb16fc0f9c8ac331 to your computer and use it in GitHub Desktop.
Tile Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#TouhouDanmakufu | |
#ScriptVersion[3] | |
#Title["tile test"] | |
@Initialize{ | |
TMain(); | |
} | |
@MainLoop{ yield; } | |
@Event{ | |
alternative(GetEventType()) | |
case(EV_REQUEST_LIFE){ | |
SetScriptResult(1); | |
} | |
} | |
let dir = GetCurrentScriptDirectory(); | |
let test = dir~"tiletest.png"; | |
task TMain(){ | |
let map = [ | |
[ObjTile_Create(0,0,0),ObjTile_Create(1,0,1),ObjTile_Create(2,0,0),ObjTile_Create(3,0,1)], | |
[ObjTile_Create(0,1,1),ObjTile_Create(1,1,0),ObjTile_Create(2,1,1),ObjTile_Create(3,1,0)], | |
[ObjTile_Create(0,2,0),ObjTile_Create(1,2,1),ObjTile_Create(2,2,0),ObjTile_Create(3,2,1)], | |
[ObjTile_Create(0,3,1),ObjTile_Create(1,3,0),ObjTile_Create(2,3,1),ObjTile_Create(3,3,0)], | |
]; | |
} | |
function ObjTile_Create(i, j, t){ | |
let obj = ObjPrim_Create(OBJ_SPRITE_2D); | |
ObjPrim_SetTexture(obj, test); | |
ObjSprite2D_SetSourceRect(obj, 0+t*24, 0, 24+t*24, 24); | |
ObjSprite2D_SetDestRect(obj, 0, 0, 24, 24); | |
ObjRender_SetPosition(obj, i*24, j*24, 0); | |
return obj; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment