Portable Game Console
PoGa-4DGL Reference Manual
And finally, alter the program again to demonstrate rotation and magnification.
Please refer to the sprite_Demo2 doc for further information on controlling multiple sprites.
A lot of information can also be gleaned from the invaders.4DG program and associated sprite file.
© 2011 4D Systems
www.4dsystems.com.au
Page 62 of 87
#platform "PoGa-GOLDELOX"
#inherit "4DGL_16bitColours.fnc" // we need to colour list for the sprites CLUT
#inherit "Demo.inc" // inherit the demo sprite bitmaps
func main()
gfx_RectangleFilled(0,0,127,40,DARKGRAY); // set a background colour
gfx_SpriteSet(demo_sprites, demo_colors, demo_palette); // pointers for the sprite generator
gfx_BlitSprite(S_Cherry, P_Cherry, 56, 10, NORTH); // display the cherry sprite at 56,50
gfx_TransparentColour(BLACK);
gfx_Transparency(ON);
gfx_BlitSprite(S_Cherry, P_Cherry, 86, 10, NORTH); // display at 86,50, transparently
var n, x, y:=42;
for(n:=0; n<8; n++)
gfx_BlitSprite(S_Cherry, P_Cherry, x, y, n); // display using all 8 orientations
x+=16;
next
var xm:=1, ym:=1;
x:=0; y:=62;
for(n:=0; n<3; n++)
txt_Width(xm); txt_Height(ym); // set sprite magnification
gfx_BlitSprite(S_Cherry, P_Cherry, x, y, NORTH); // display in 3 sizes
xm++; ym++; x+=16*xm;
next
repeat forever
endfunc