Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Helmet
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: Brazil
Posted: 23rd Feb 2003 06:46
How can I use GET IMAGE to produce an animation?
MM is good
LLX
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location:
Posted: 23rd Feb 2003 06:48
make a strip of the animation frames
gram the cortinates the take only one section, one frame, of the stripe, grap the next motion in the strip and loop them...

Helmet
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: Brazil
Posted: 23rd Feb 2003 07:01
Could you give me an example and explain me?

MM is good
LLX
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location:
Posted: 23rd Feb 2003 07:05


Helmet
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: Brazil
Posted: 23rd Feb 2003 07:12
It doesn't open in my navigator.

MM is good
Jadelion
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location:
Posted: 23rd Feb 2003 07:15
Ok, here is a simple exampel of a SPRITE animation using GET IMAGE

Jadelion
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location:
Posted: 23rd Feb 2003 07:16
Sorry here it is out of the code snippet box.


HIDE MOUSE


box 0,0,50,50

PRINT "A"

GET IMAGE 1,0,0,50,50

CLS


box 0,0,50,50

PRINT "B"

GET IMAGE 2,0,0,50,50

CLS

SPRITE_IMAGE# = 1

DO
SPRITE 1,320,240,SPRITE_IMAGE#
INC SPRITE_IMAGE#
IF SPRITE_IMAGE# = 3 THEN SPRITE_IMAGE# = 1

LOOP
Helmet
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: Brazil
Posted: 23rd Feb 2003 07:19
Thank you very much.

MM is good
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 23rd Feb 2003 07:37
of course if your using sprites, use play sprite and it will auto loop your animation for you.

Helmet
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: Brazil
Posted: 28th Feb 2003 15:21
I tried out but how can I grab the cordinates?

MM is good
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 1st Mar 2003 05:51
GET IMAGE 2,0,0,50,50

means


GET IMAGE imgnum,X1,Y1,X2,Y2

add a for loop to jump across the division size eg: 32
then use the get image command in the loop and it should
grab progressive windows to form cells for your animations


keep in mind

GET IMAGE imgnum,X1,Y1,X2,Y2

imgnum progressivley increases to make new image locations

the X1,Y1,X2,Y2 variables are incremented by the division factor and depending on which way u created the strip of cells eg: horizontally and vertically or in a 2d grid if there are lots of them

Helmet
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: Brazil
Posted: 1st Mar 2003 07:15
I think you didn't understand. I want to know where I find the cordinates.

MM is good
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 1st Mar 2003 16:39
You need to find them yourself. I suggest just making a little snippet so if you click on a point it prints the coords, thats what I do

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!
Helmet
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: Brazil
Posted: 2nd Mar 2003 01:16
I have this example:

SET DISPLAY MODE 512,384,16
rem DISABLE ESCAPEKEY
DIM Map(15,12)
REM Esta é a ordem 2D que será
REM usado segurar os dados de mapa.
text 512/2,384/2, "Loading..."
LOAD BITMAP "Map.bmp",1
FOR y=0 to 1
FOR x=0 to 3
GET IMAGE 1+x+(y*4),(x*32),(y*32),(x*32)+32,(y*32)+32
NEXT x
NEXT y
DELETE BITMAP 1

FOR Y = 0 TO 12
REM Estas pequenas leituras rotineiras do DATA
FOR X = 0 TO 15
REM na ordem de mapa. Nós usaremos
READ Map(X, Y) :REM o DATA para puxar o mapa e teste
REM na ordem de mapa. Nós usaremos
NEXT X :REM onde o jogador pode e não pode

NEXT Y :REM se mover.

sync on
HIDE MOUSE

Imagem=1
FOR Y = 0 TO 12
FOR X = 0 TO 15
Imagem=Map(X,Y) +1
paste image Imagem,(X*32),(Y*32)

NEXT X
NEXT Y

LOAD BITMAP "Hero.bmp",1
FOR y=0 to 3
FOR x=0 to 2
GET IMAGE 9+x+(y*3),(x*32),(y*32),(x*32)+32,(y*32)+32
NEXT x
NEXT y
DELETE BITMAP 1
SYNC OFF
PlayerX=7
PlayerY=8
Moved = 1
X = PlayerX * 32
Y = PlayerY * 32
SPRITE 1,X,Y,16
Sair=0
SYNC OFF
repeat
sync on
IF ESCAPEKEY()=1 THEN Sair=1
if rightkey()=1 or joystick right()=1
IF Map(PlayerX + 1, PlayerY) < 5
gosub DrawBackGround
PlayerX = PlayerX + 1
Moved = 1
ENDIF: ENDIF
if leftkey()=1 or joystick left()=1
IF Map(PlayerX - 1, PlayerY) < 5
GOSUB DrawBackGround
PlayerX = PlayerX - 1
Moved = 1
ENDIF:ENDIF
if downkey()=1 or joystick down()=1
IF Map(PlayerX, PlayerY + 1) < 5
GOSUB DrawBackGround
PlayerY = PlayerY + 1
Moved = 1
ENDIF:endif
if upkey()=1 or joystick up()=1
IF Map(PlayerX, PlayerY - 1) < 5
GOSUB DrawBackGround
PlayerY = PlayerY - 1
Moved = 1
ENDIF:endif
if Moved=1
sync off
X = PlayerX * 32
Y = PlayerY * 32
sprite 1,x,y,16
Moved=0
endif
until Sair=1
rem DISABLE ESCAPEKEY
DrawBackGround:
sync on
FOR Y = 0 TO 12
FOR X = 0 TO 15
Imagem=Map(X,Y) +1
paste image Imagem,(X*32),(Y*32)

NEXT X
NEXT Y

return
cls
text 512/2,384/2, "Obrigado por Jogar!"
suspend for key
delete sprite 1


REM Abaixo de é o dados para um pequeno nível enfadonho que eu criei. Você pode
REM mudar isto ao redor de qualquer forma você quer.

DATA 5,7,7,7,7,7,7,6,6,7,7,7,7,7,7,5

DATA 5,1,1,0,0,0,0,3,3,0,0,0,0,1,1,5

DATA 5,5,5,5,5,5,5,4,4,5,5,5,5,5,5,5

DATA 6,6,6,6,0,0,0,3,3,0,0,0,1,6,6,6

DATA 6,6,1,1,1,1,0,3,3,0,1,1,1,1,6,6

DATA 2,6,6,1,1,1,1,3,3,0,1,1,1,1,6,6

DATA 2,6,6,1,1,1,1,3,3,1,1,1,1,1,1,6

DATA 2,2,6,6,1,1,1,3,3,1,1,1,1,1,0,5

DATA 2,2,2,6,6,1,1,3,3,1,1,1,0,0,5,5

DATA 2,2,6,6,6,5,5,5,5,5,5,5,5,5,5,5

DATA 2,2,6,6,5,5,5,5,5,5,5,5,5,5,5,5

DATA 2,2,6,6,5,5,5,5,5,5,5,5,5,5,5,5

DATA 2,2,6,6,5,5,5,5,5,5,5,5,5,5,5,5



What is it?
FOR y=0 to 1
FOR x=0 to 3
GET IMAGE 1+x+(y*4),(x*32),(y*32),(x*32)+32,(y*32)+32
NEXT x
NEXT y

I didn't understand. Could anyone explain me?

MM is good

Login to post a reply

Server time is: 2024-11-24 04:22:20
Your offset time is: 2024-11-24 04:22:20