transcribe 1-1 as testing World
GitOrigin-RevId: 0267ea2f77636413d5681b212a23177de47c91dd
This commit is contained in:
parent
81b62f883e
commit
d3283a64c0
@ -10,7 +10,10 @@ namespace Jumpy {
|
||||
GrassL,
|
||||
GrassR,
|
||||
Rock,
|
||||
Water
|
||||
RockL,
|
||||
RockR,
|
||||
Water,
|
||||
Block
|
||||
}
|
||||
|
||||
class Tile {
|
||||
@ -52,11 +55,26 @@ namespace Jumpy {
|
||||
spriteBatch.Draw(texture, drawPos, source, Color.White);
|
||||
break;
|
||||
}
|
||||
case Terrain.RockL: {
|
||||
Rectangle source = new Rectangle(1 * size, 2 * size, size, size);
|
||||
spriteBatch.Draw(texture, drawPos, source, Color.White);
|
||||
break;
|
||||
}
|
||||
case Terrain.RockR: {
|
||||
Rectangle source = new Rectangle(5 * size, 2 * size, size, size);
|
||||
spriteBatch.Draw(texture, drawPos, source, Color.White);
|
||||
break;
|
||||
}
|
||||
case Terrain.Water: {
|
||||
Rectangle source = new Rectangle(9 * size, 2 * size, size, size);
|
||||
spriteBatch.Draw(texture, drawPos, source, Color.White);
|
||||
break;
|
||||
}
|
||||
case Terrain.Block: {
|
||||
Rectangle source = new Rectangle(6 * size, 3 * size, size, size);
|
||||
spriteBatch.Draw(texture, drawPos, source, Color.White);
|
||||
break;
|
||||
}
|
||||
case Terrain.Empty:
|
||||
default:
|
||||
break;
|
||||
@ -75,18 +93,18 @@ namespace Jumpy {
|
||||
public int Height { get; }
|
||||
|
||||
string[] worldDesc = new string[] {
|
||||
" X ",
|
||||
" . ",
|
||||
" .",
|
||||
" .",
|
||||
" <=> === .",
|
||||
" .",
|
||||
" .",
|
||||
" <=> <=> ======== == .",
|
||||
" = == .",
|
||||
" == .",
|
||||
" .",
|
||||
"=============> <==================================================================.",
|
||||
"..............~~~~~................................................................." };
|
||||
" X <======> <==X X <=> <XX> XX . ",
|
||||
" XXX . ",
|
||||
" XXXX . ",
|
||||
" XXXXX . ",
|
||||
" X <X=X> <> <> <X> = <> X X X X <> X X XX X <=X> XXXXXX . ",
|
||||
" <> [] [] XX XX XXX XX XXXXXXX . ",
|
||||
" <> [] [] [] XXX XXX XXXX XXX <> <> XXXXXXXX ",
|
||||
" []12345678[]123456[]123456789[]1234567890 123456 123456 12345 1234 12345 1234 123XXXX XXXX1234XXXXX XXXX1234[]123 1234567[]XXXXXXXXX12345678 ",
|
||||
"===========================..========..======..=========..=========> <=============> <==============================================================> <=======..==============..==============================",
|
||||
"...................................................................] [.............] [..............................................................] [......................................................." };
|
||||
|
||||
public World(Texture2D texture) {
|
||||
// TODO: better error handling for if the string[] isn't rectangular.
|
||||
@ -109,9 +127,18 @@ namespace Jumpy {
|
||||
case '.':
|
||||
terrain = Terrain.Rock;
|
||||
break;
|
||||
case '[':
|
||||
terrain = Terrain.RockL;
|
||||
break;
|
||||
case ']':
|
||||
terrain = Terrain.RockR;
|
||||
break;
|
||||
case '~':
|
||||
terrain = Terrain.Water;
|
||||
break;
|
||||
case 'X':
|
||||
terrain = Terrain.Block;
|
||||
break;
|
||||
case ' ':
|
||||
default:
|
||||
terrain = Terrain.Empty;
|
||||
|
Loading…
Reference in New Issue
Block a user