Rotate Sprites (New Features)

by lrcvs, Saturday, November 03, 2012, 12:44 (1694 days ago)

For future versions ...


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


Regards

Rotate Sprites, Simulation turtle, Part I

by lrcvs, Saturday, November 03, 2012, 22:15 (1694 days ago) @ lrcvs

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
GRAD = RADIANS (GRA)
X = (R*COS(GRAD))+ 100
Y = (R*SIN(GRAD))+ 100
FON$ = GETSLICE (X-10,Y-10,20,20)
IMGLOAD X,Y,1,GRAD,"TOR"
PUTSLICE X-10,Y-10,FON$
COLOR WHITE : LINE X0,Y0, X,Y

X0 = X
Y0 = Y
NEXT GRA

IMGLOAD X,Y,1,GRAD,"TOR"

Rotate Sprites, Simulation turtle, Part II

by lrcvs, Saturday, November 03, 2012, 22:17 (1694 days ago) @ lrcvs

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
G = RADIANS (360-N)
IMGLOAD 10,10,1,G,"TOR"
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

by Jim ⌂ @, Russell, KY, Sunday, November 04, 2012, 04:01 (1693 days ago) @ lrcvs

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

by M Santos, Thursday, November 08, 2012, 16:13 (1689 days ago) @ lrcvs

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

by lrcvs, Thursday, November 08, 2012, 18:45 (1689 days ago) @ M Santos
edited by lrcvs, Thursday, November 08, 2012, 18:49

Hi, Manuel Santos:

Thanks for your comment.!

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
G = RADIANS (360-N)
IMGLOAD 10,10,1,G,"TOR"
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!!!!

RSS Feed of thread
powered by my little forum