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

#1 2012-03-01 14:41:34

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Getting terrain number

How do I do this? I'm making a scrolling game, and the ground isn't all one colour, so I can't use that block, and I really don't wanna have to put loads of "or"s in.

I figure it may work to make a list with all the terrains, and then just put:

<touching (item (Terrain_number) of [Terrains v])?>
I'm pretty sure than wouldn't even work, but it'd still be useful to know how to get the terrain number for future reference.

I'm guessing it'll require a mod block or something.


Why

Offline

 

#2 2012-03-01 16:31:53

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

Re: Getting terrain number

I'm a little confused.  Is the list a list of the names of the terrain sprites' names and the "terrain_number" the terrain you're currently standing on?  In that case, something like
Round((X+x position)/480) should do it (you may have to adjust it to round down, or shift it with a constant).

Edit: P.S. if that's your idea, I think it is a great one  smile

Last edited by MoreGamesNow (2012-03-01 16:33:32)


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

Offline

 

#3 2012-03-01 16:45:43

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Getting terrain number

Yes, that's what I mean.

And thanks  smile


Why

Offline

 

Board footer