Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> animated BG's and other BG stuff in GM7 PRO, I don't get it T.T
United States
smbmaster99
Posted: Dec 20 2008, 11:18 AM
Quote Post


normal member...


Group Icon
Group: Members
Posts: 140
Member No.: 5818
Joined: 3-November 08

Status: (0d) [--]


I was wondering, how do you animate backgrounds in GM7 PRO? Like waterfalls from SMAS SMB1, or SMAS SMB3. I was also wondering something else about backgrounds. How do you make backgrounds move quicker or slower than something else behind it? I mean like in Yoshi's Island for instance. If there were some hills, & there were clouds behind it, how would you make the hills go quicker than the clouds? I know it's possible in GM 'cause I've seen it done in fangames before.
PMEmail Poster
Top
India
Char
Posted: Dec 20 2008, 11:48 AM
Quote Post


fad was bad
[M][*][*]

Group Icon
Group: Admins
Posts: 2123
Member No.: 2856
Joined: 25-October 06

Status: (0d) [--]


for a 2-frame background:
Controller Create Event:
alarm[0] = x; // Replace x with a value for speed.

Controller Alarm 0
if (background_index[0] != frame1) // Replace frame1 with the first frame of the waterfall background
 background_index[0] = frame1;
else
 background_index[0] = frame2; // Replace frame2 with the second frame


--------------------
aa this broke


Make your own | If a level is breaking the rules, note the ID and PM me.
Reference (thanks Frogjester!)
PMEmail PosterUsers WebsiteAOLYahooMSN
Top
United States
Littlink
Posted: Dec 20 2008, 11:51 AM
Quote Post


hip 2b square
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 5146
Member No.: 2010
Joined: 11-April 06

Status: (0d) [--]


Alter it as you see fit.
CODE
//NEW Scrolling / Parallax BG Code that seems to work.//

//When using multiply, larger numbers are slower in this case.
//bg_x,y[0,1,2,3..] Sets the prefered bg. view_x,y Sets the current viewable bg. *0.xx; Sets the BG's speed.

background_x[0] = view_xview[view_current]//Closest BG 5 - Fastest Scroll...
background_y[0] = view_yview[view_current]//Closest BG 5 - *0.00 when set, will scroll

background_x[1] = view_xview[view_current]*.60; //Distant BG 0 - Slowest Scroll...
background_y[1] = view_yview[view_current]*1; //Distant BG 0

background_x[2] = view_xview[view_current]*.50; //Distant BG 1
background_y[2] = view_yview[view_current]*1; //Distant BG 1

background_x[3] = view_xview[view_current]*.40; //Closer BG 2
background_y[3] = view_yview[view_current]*1; //Closer BG 2

background_x[4] = view_xview[view_current]*.30; //Even Closer BG 3
background_y[4] = view_yview[view_current]*1; //Even Closer BG 3

background_x[5] = view_xview[view_current]*.20; //Really Close BG 4
background_y[5] = view_yview[view_current]*1; //Really Close BG 4

background_x[6] = view_xview[view_current]*.10;//Closest BG 5 - Fastest Scroll...
background_y[6] = view_yview[view_current]*1;//Closest BG 5 - *0.00 when set, will scroll
//                                                               the same speed as the tileset
//                                                               divide ( /x.xx ) will reverse direction

//Copy and paste the below code for each additional BG.
//Remove the "//"'s that preceed it. BLUE code is ACTIVE code.

//background_x[0] = view_xview[view_current]*0.00;
//background_y[0] = view_yview[view_current]*0.00;



--------------------
[████████░░] 80%

user posted image
PMUsers WebsiteMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0403 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.35 ]