Path: chuka.playstation.co.uk!news From: "Chris Wallace" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Own BG with GsSPRITES Date: Sun, 21 Jul 2002 13:02:50 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 94 Message-ID: References: NNTP-Posting-Host: host217-34-82-100.in-addr.btopenworld.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 ok, dunno if its anyuse but here is my BG loop: for(x=0;x<10;x++) //10 on x for(y=0;y<8;y++) //8 on y { BGsprite.u = ter_type[level][y][x]*32; /*selects from the 3D array the level being played, the y and x cords and uses x, and y to find the tile type*/ BGsprite.v = (level/3)*32; /* uses the level number to find the v value, as the terain type (sand,grass etc) go down the graphic and different tile across*/ BGsprite.x = x*32; BGsprite.y = y*32; GsSortSprite(&BGsprite, &world_ordering_table[output_buffer_index], 2); /*display each tile as it is proceced*/ } below is my level array.. char ter_type[26][8][10] = { //0 GRASS 0,1,0,0,0,0,0,0,0,0, 0,0,0,0,1,0,0,1,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,1,0,2,3,2,3,0,0, 0,0,0,0,4,5,4,5,0,0, 1,2,6,3,0,0,0,0,0,0, 0,4,7,5,0,0,1,0,0,0, 0,0,1,0,0,0,0,0,1,0, //1 0,1,0,0,0,0,0,0,0,0, 0,0,0,0,1,0,0,1,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,1,0,2,3,2,3,0,0, 0,0,0,0,4,5,4,5,0,0, 1,2,6,3,0,0,0,0,0,0, 0,4,7,5,0,0,1,0,0,0, 0,0,1,0,0,0,0,0,1,0, //2 0,1,0,0,1,0,0,0,0,0, 0,0,2,3,0,0,0,1,0,0, 0,0,4,5,1,0,0,0,0,0, 0,1,1,0,2,3,2,3,0,0, 0,0,0,0,4,5,4,5,0,0, 1,2,6,3,0,1,0,0,0,0, 0,4,7,5,0,0,1,0,0,0, 0,0,1,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