This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-02-06 13:51:20

Borrego6165
Scratcher
Registered: 2011-03-10
Posts: 1000+

I am making a different kind of scrolling and need help!

Basically, I am making a 4th city game. As many may know, my Generation:3000 project did not go too well, as it required 96 sprites for each tile just to get the city moving.

What I need is the same effect, except you can only see say 9 sprites on the screen (one in the middle and the others showing half a side). So, instead of having to make 96 tiles, I should hopefully only have to make 9, because whilst one is roughly in the middle of the screen, the others are on the edges of the screen. The idea is, when it reaches the edge, is darts off to the other side of the screen, to make a loop affect. However, when it does this it must change costume.

The problem with costumes is, if this were a linear game than I could easily make it change to any costume I WANT it to be. However, because this is a building game, it would have to read off a list what building it must show. Because it cannot look like a park if a player placed a house in that spot.

PLEASE HELP!
IT WOULD HELP THE FOLLOWING GAME:
+Build in 5 different locations: China, France, Spain, Egypt and Ireland!
+Build around (undecided) 30 buildings!
+On a grid of 324 tiles! (Over triple the amount in the last game, which had a mere 96 tiles).
+Has a fun campaign mode!


Generation:4001 Build a beautiful city, with over 50 objects and over 10000 tiles per city! This simulates traffic, pollution, tourism, crime and more!

Offline

 

#2 2012-02-06 16:38:42

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: I am making a different kind of scrolling and need help!

If I understand you correctly, you want, what is basically, a 2D list.

(y-position * width) + x-position + 1 would work for a list like this:

      0  1  2  3  4  5  6  7  8  9  10 ... x positions
0|  x  x  x  x  x   x  x  x  x  x   x
1|  x  x  x  x  x   x  x  x  x  x   x
2|  x  x  x  x  x   x  x  x  x  x   x
4|  x  x  x  x  x   x  x  x  x  x   x


Asking for the item at (4,3) in a list that is 10 by 4, would get you 44.  Asking for (0,0) would get you item 1.  Asking for (0,1) would get you item 11.

Last edited by MoreGamesNow (2012-02-06 16:41:53)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#3 2012-02-06 16:45:35

Borrego6165
Scratcher
Registered: 2011-03-10
Posts: 1000+

Re: I am making a different kind of scrolling and need help!

MoreGamesNow wrote:

If I understand you correctly, you want, what is basically, a 2D list.

(y-position * width) + x-position + 1 would work for a list like this:

      0  1  2  3  4  5  6  7  8  9  10 ... x positions
0|  x  x  x  x  x   x  x  x  x  x   x
1|  x  x  x  x  x   x  x  x  x  x   x
2|  x  x  x  x  x   x  x  x  x  x   x
4|  x  x  x  x  x   x  x  x  x  x   x


Asking for the item at (4,3) in a list that is 10 by 4, would get you 44.  Asking for (0,0) would get you item 1.  Asking for (0,1) would get you item 11.

thanks! i'll give it a try!

HOW DOES THE COSTUME CHANGE?

Last edited by Borrego6165 (2012-02-06 16:53:48)


Generation:4001 Build a beautiful city, with over 50 objects and over 10000 tiles per city! This simulates traffic, pollution, tourism, crime and more!

Offline

 

#4 2012-02-06 17:11:10

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: I am making a different kind of scrolling and need help!

Oh... right, sorry for leaving that out.

Switch to costume[(formula above)]
X and Y position are the x and y positions of the squares on the grid.

Last edited by MoreGamesNow (2012-02-06 17:11:34)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer