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

#1 2008-12-18 13:47:10

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Terrian Costume Arrangment

Hey

I'm making a RPG at the moment, which uses multiple terrian costumes, some from different areas. My question is, What is the best way to arrange these costume's so I can use a smaller script rather than saying:

<if><< <( <{ terrian }> <=> 5 )> <and> <( <y position> <=> 180 )> >>
<set{ terrian }to( 6 )

As doing this for loads of costumes would take a lot of time, and I'm sure theres an easy way of doing this.

If you don't know what I mean look at Mayhem's project: Wandering Knight, which has 100 terrian costumes and uses N-S and E-W Co-ordinates, however only uses one area of a 10 x 10 grid. I want mine to be multiple areas.

Any help would be great  smile


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#2 2008-12-18 14:28:19

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Terrian Costume Arrangment

Fairly simple - use the same method I did but add a 100s digit for your different areas.

So, when your character is in area 0, row 5 column 3, you switch to costume 053

When your PC is in a new area, say area 3, then if they are in row 4 column 6 switch to costume 346.

However, you will need to make sure you have no gaps in the costumes.  You can do it with a less than 10x10 area without much difficulty (I can explain later if need be) but I strongly recommend you use areas that are the same size.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#3 2008-12-18 15:05:59

mrweston
Scratcher
Registered: 2007-12-13
Posts: 100+

Re: Terrian Costume Arrangment

Interesting...

I've been working on something similar, and after reading that thought I might be able to use it, but it only works if you've got a completely sequential set of background costumes.

So for, say, a 2x2-map area, you've got coordinates of (1,1), (1,2), (2,1), and (2,2). I thought maybe you could do "Switch to background ((10 x X-position) + Y-position))", with the costumes labelled "11", "12", "21", and "22", but when you drop a number into that block, it goes by the costume's order-number, not its name. Bah!

Hmm... there's gotta be a better way...

Offline

 

#4 2008-12-18 16:17:50

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Re: Terrian Costume Arrangment

Mayhem wrote:

Fairly simple - use the same method I did but add a 100s digit for your different areas.

So, when your character is in area 0, row 5 column 3, you switch to costume 053

When your PC is in a new area, say area 3, then if they are in row 4 column 6 switch to costume 346.

However, you will need to make sure you have no gaps in the costumes.  You can do it with a less than 10x10 area without much difficulty (I can explain later if need be) but I strongly recommend you use areas that are the same size.

Hm... Nice idea. I'll try it tomorrow.

Cheers for the help  smile


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

Board footer