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

#1 2010-09-15 14:53:43

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Help: Scrolling & Stamping

Well, I'm making a project that stamps the floor. I am using X and Y positions and saving all the floors in Lists ( SX,SY,SZ,ST aka Stamp X, Stamp Y, Stamp Z, Stamp Type ) using the variables for placement ( PX,PY,PZ,Line aka Placement X, Y, X, etc... ).

I want it so when you press the up arrow key, it refreshes the display, but you moved "one square forward" ( All the floors, walls, etc.. are squares Example:

[][][][][][][][][][]
[][][][][][][][][][]
[][][][][][][][][][]
[][][][][][][][][][]
[][][][][][][][][][]

) But I'm running into the problem of "which next set of squares to load next?" I can get the starting up, but I don't want it displaying all the squares over and over, causing unnecessary lag. What could I do so I can load each 100x100 squares and not 1000x1000 squares. Only the necessary squares to show on the Display?

Offline

 

#2 2010-09-15 19:29:12

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Help: Scrolling & Stamping

Well, I think you need to figure out the "window" of list index values that correspond with each floor....and then only display those values, using a loop.  Does that make any sense to you? 

Maybe start with a simplified version of your problem and get that working right, then scale it up to full size.  For instance, you could start with a 10x10 floor...so each floor would need 100 items.  Presumably floor 1 would be from list index 1 to 100 while floor 2 would go from 101 to 200 and so on.  With this approach, make a variable for your floor number and then compute the index values for the loop.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2010-09-15 21:22:43

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Help: Scrolling & Stamping

I'm thinking of moving to 5x5 it's currently 18x24.

I was thinking about that to, but I want it so others can make their own maps. But I have absolutely no idea how I am going to get this to work. So I plan on making a map maker, then the project to run the maps. ( Straying from topic a bit ) Could you give me an example? ( Just cause you are really skilled at this sort of stuff and it's easier to learn from visualization instead of just talking about it. ) What you just said didn't make sense ( sadly ) but I'll do my best to understand it.

I was thinking of using North, South, East, West lists, and using variables to add or decrease how far North, South, East, or West you were. But that drove me just as crazy. So I've decided to stick with my original idea.

Offline

 

#4 2010-09-17 20:21:17

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Help: Scrolling & Stamping

I'm thinking of just having "rooms" now, 1-100, 101-200. If that's what you meant, then it there should be less complaints of slow displaying. ( I already have some complaints of my own about it. ) But then how will it know which room for it to display? Will I have a list of which room leads to which? And I also want to stick to 18x24 squares, it looks pretty good that way right now.

Last edited by Magnie (2010-09-17 20:22:19)

Offline

 

Board footer