Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 984 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Animation w/ bitmaps #221448
08/14/08 03:08
08/14/08 03:08
Joined: Aug 2006
Posts: 70
NJ
S
SirCamaris Offline OP
Junior Member
SirCamaris  Offline OP
Junior Member
S

Joined: Aug 2006
Posts: 70
NJ
I created one large bitmap and divided it into equal portions. Each portion serves as a single animation frame. I'm able to cycle through the frames, however my code to do so is redundant. Here is a sample:
while (1)
{if (key_cud == 1)
{animate_x = 0;
animate_y = 60;
wait(wait_time);
animate_y = 120;
wait(wait_time);
}
else animate_y = 0;
I tried "animate_y += 60;", but this only skips to 120, completely by passing frame 60. Please offer suggestions.

Re: Animation w/ bitmaps [Re: SirCamaris] #221452
08/14/08 03:36
08/14/08 03:36
Joined: Apr 2006
Posts: 624
DEEP 13
badapple Offline
User
badapple  Offline
User

Joined: Apr 2006
Posts: 624
DEEP 13
im not sure what you re doing with your code there but animated sprites can be animated with frame , like my.frame+=10*time;

Re: Animation w/ bitmaps [Re: SirCamaris] #221453
08/14/08 03:36
08/14/08 03:36
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
have you looked in the manual?

while (1) {
my.frame += time_step; // 16 frames per second
if (my.frame > 30) { my.next_frame = 20; } // interpolate to start frame
else { my.next_frame = 0; } // interpolate to FRAME+1
if (my.frame >= 31) { my.frame -= 10; } // if end frame reached, skip back
wait(1);
}

use somewhere in the code
while(!key_cud){wait(1);}
to make it pause


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1