# Rotate Sprites (New Features)

For future versions ...

The possibility that the "sprites" to rotate through its center point?

Regards

## Rotate Sprites, Simulation turtle, Part I

CLS : CLG
GRAPHSIZE 10,10
COLOR GREEN
#DIBUJA LA TORTUGA INICIAL
CLG
LINE 0,5,10,0
LINE 0,5,10,10
LINE 5,5,10,10
LINE 5,5,10,0
IMGSAVE "TOR"

GRAPHSIZE 400,400
COLOR RED : RECT 0,0,400,400
COLOR BLUE : CIRCLE 200,200,150
R = 100

X0 = (R*COS(0))+ 100
Y0 = (R*SIN(0))+ 100

FOR GRA = 0 TO 360
FON\$ = GETSLICE (X-10,Y-10,20,20)
PUTSLICE X-10,Y-10,FON\$
COLOR WHITE : LINE X0,Y0, X,Y

X0 = X
Y0 = Y
NEXT GRA

## Rotate Sprites, Simulation turtle, Part II

CLS : CLG
GRAPHSIZE 22,22
SPRITEDIM 360
COLOR CLEAR
RECT 0,0,21,21
COLOR BLACK
LINE 0,0,21,11
LINE 0,21,21,11
LINE 11,11,0,0
LINE 11,11,0,21
IMGSAVE "TOR"
CLG
FOR N = 0 TO 359
SPRITESLICE N,0,0,22,22
PAUSE 0.01
CLG
NEXT N

CLG
GRAPHSIZE 400,400

COLOR WHITE
RECT 0,0,400,400
COLOR RED
LINE 200,0,200,400
LINE 0,200,400,200

Z = 0
FOR N = 0 TO 359

FON\$ = GETSLICE (N-20,180,40,40)
SPRITEMOVE Z,N,200
SPRITESHOW Z
PUTSLICE N-20,180,FON\$
COLOR BLUE : PLOT N,200
FON\$ = ""
Z = Z + 1
IF Z = 360 THEN Z = 0
NEXT N

END

## Rotate Sprites, Simulation turtle, Part II

Added two additional arguments to SPRITEMOVE and SPRITEPLACE for rotation and scaling. See Examples/sprites/spritetest3.kbs for an example (degrees in radians)

Pushed to SVN and numbered 0.9.9.15

## Rotate Sprites

That is a really good idea to make “children friendly” programs. Sprites however are not practical for exchanging programs,which is a shame.

The motto "copy paste and run" doesn't work.

A good idea would be to have a nice set of sprites with some cars, planes, pets and people in the Basic 256 sprites folder.

The motto would be then "copy paste, save in the sprites folder and run" not as catchy but still practical.

Manuel

## Rotate Sprites

Hi, Manuel Santos:

I'm not thinking of creating a common library on the web of Basic-256 with sprites.

Let me explain:

What I say, is the property of a sprite, can rotate 360 degrees around its center at any point on the screen.

So I checked, the only sprites can move in any direction, but not rotate on themselves.

An image can be rotated 360 degrees if, but not a sprite.

And my question is:

They can rotate 360 ​​degrees on its own sprites geometric center?

See you this example:

::::::::::::::::::::::::::::::::::::::::::::::::::

CLS : CLG
GRAPHSIZE 22,22
SPRITEDIM 360
COLOR CLEAR
RECT 0,0,21,21
COLOR BLACK
LINE 0,0,21,11
LINE 0,21,21,11
LINE 11,11,0,0
LINE 11,11,0,21
IMGSAVE "TOR"
CLG
FOR N = 0 TO 359
SPRITESLICE N,0,0,22,22
PAUSE 0.01
CLG
NEXT N

CLG
GRAPHSIZE 400,400

COLOR WHITE
RECT 0,0,400,400
COLOR RED
LINE 200,0,200,400
LINE 0,200,400,200

Z = 0
FOR N = 0 TO 359

FON\$ = GETSLICE (N-20,180,40,40)
SPRITEMOVE Z,N,200
SPRITESHOW Z
PUTSLICE N-20,180,FON\$
COLOR BLUE : PLOT N,200
FON\$ = ""
Z = Z + 1
IF Z = 360 THEN Z = 0
NEXT N

END

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
I like this!!!!