Changeset 20

User picture

Author: darkantoine

(2010/03/20 13:33) About 2 years ago


  

Affected files

Updated RPG/Character.cs Download diff

1920
6
6
7
namespace RPG
7
namespace RPG
8
{
8
{
9
    class Character
9
    public class Character: GameObject
10
    {
10
    {
11
        public String Name;
11
        public String Name;
12
        public Vector2 Position;
12
        public int[] Coord;
13
13
14
        public DisplayObject DO;
14
        public string Direction;
15
        public int step;
15
16
16
        public Character(DisplayObject D)
17
        public Character(DisplayObject DO, Display D):base(DO,D)
17
        { 
18
        {
18
            Name = "MyCharacter";
19
            Name = "MyCharacter";
19
            Position = new Vector2(0, 0);
20
            Coord = new int[2];
20
            Texture = "perso";
21
            Coord[0] = Coord[1] = 0;
22
            this.DO=DO;
23
            this.DO.Position.X = 0;
24
            this.DO.Position.Y = 0;
21
25
22
            DO = D;
26
            if (DO.SpriteList["Default"].Width >= Globals.GAME_WIDTH/Globals.NB_CASES_X)
23
        }   
27
            {
28
                DO.scale = ( float) Globals.GAME_WIDTH/Globals.NB_CASES_X / (float)DO.SpriteList["Default"].Width;
29
            }
30
            step = 0;
31
            Direction = "None";
32
           
24
33
34
        }
35
36
        public void move(String S)
37
        {
38
            if(Direction.Equals("None"))
39
            {
40
            Direction = S;
41
            step = 0;
42
            }
43
        }
44
45
        public new void  update()
46
        {
47
            if (Direction.Equals("None"))
48
            {
49
                return;
50
            }
51
            if (step < 50)
52
            {
53
                
54
                if (Direction.Equals("Left"))
55
                {
56
                    this.DO.Shift.X += 7.0f;
57
                }
58
59
                if (Direction.Equals("Right"))
60
                {
61
                    this.DO.Shift.X -= 7.0f;
62
                }
63
64
65
                if (Direction.Equals("Up"))
66
                {
67
                    this.DO.Shift.Y += 7.0f;
68
                }
69
70
71
                if (Direction.Equals("Down"))
72
                {
73
                    this.DO.Shift.Y -= 7.0f;
74
                }
75
                step++;
76
            }
77
78
            else
79
            {
80
                DO.Shift = Vector2.Zero;
81
82
                if (Direction.Equals("Left"))
83
                {
84
                    Coord[0] = Coord[0] - 1 % Globals.NB_CASES_X;
85
                    this.DO.Position.X -= (float)Globals.GAME_WIDTH / Globals.NB_CASES_X;
86
                }
87
88
                if (Direction.Equals("Right"))
89
                {
90
                    Coord[0] = Coord[0] + 1 % Globals.NB_CASES_X;
91
                    this.DO.Position.X += (float)Globals.GAME_WIDTH / Globals.NB_CASES_X;
92
                }
93
94
95
                if (Direction.Equals("Up"))
96
                {
97
                    Coord[1] = Coord[1] - 1 % Globals.NB_CASES_Y;
98
                    this.DO.Position.Y -= (float)Globals.GAME_HEIGHT / Globals.NB_CASES_Y;
99
                }
100
101
102
                if (Direction.Equals("Down"))
103
                {
104
                    Coord[1] = Coord[1] + 1 % Globals.NB_CASES_Y;
105
                    this.DO.Position.Y += (float)Globals.GAME_HEIGHT / Globals.NB_CASES_Y;
106
                }
107
                step = 0;
108
                Direction = "None";
109
            }
110
111
        }
112
113
114
25
    }
115
    }
26
}
116
}

Updated RPG/Content/Content.contentproj Download diff

1920
65
      <Processor>TextureProcessor</Processor>
65
      <Processor>TextureProcessor</Processor>
66
    </Compile>
66
    </Compile>
67
  </ItemGroup>
67
  </ItemGroup>
68
  <ItemGroup>
69
    <Compile Include="background.jpg">
70
      <Name>background</Name>
71
      <Importer>TextureImporter</Importer>
72
      <Processor>TextureProcessor</Processor>
73
    </Compile>
74
  </ItemGroup>
75
  <ItemGroup>
76
    <Compile Include="Basketball.png">
77
      <Name>Basketball</Name>
78
      <Importer>TextureImporter</Importer>
79
      <Processor>TextureProcessor</Processor>
80
    </Compile>
81
  </ItemGroup>
68
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets"
/>
82
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets"
/>
69
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
83
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
70
       Other similar extension points exist, see Microsoft.Common.targets.
84
       Other similar extension points exist, see Microsoft.Common.targets.

Updated RPG/Display.cs Download diff

1920
14
14
15
namespace RPG
15
namespace RPG
16
{
16
{
17
    class Display
17
    public class Display
18
    {
18
    {
19
             
19
             
20
        public Rectangle viewportRect;
20
        public Rectangle viewportRect;
...
...
23
        public GraphicsDeviceManager graphics;
23
        public GraphicsDeviceManager graphics;
24
        List<DisplayObject> Objects;
24
        List<DisplayObject> Objects;
25
25
26
        Texture2D background;
26
27
27
28
        public Display(Game1 G)
28
        public Display(Game1 G)
29
        {
29
        {
30
            game = G;
30
            game = G;
...
...
34
            {
34
            {
35
                throw new NullReferenceException();
35
                throw new NullReferenceException();
36
            }
36
            }
37
            graphics.PreferredBackBufferHeight = 600;
38
            graphics.PreferredBackBufferWidth = 800;
39
            background = null;
37
           
40
           
38
        }
41
        }
39
        public void Initialize()
42
        public void Initialize()
...
...
43
46
44
            Objects = new List<DisplayObject>(10);
47
            Objects = new List<DisplayObject>(10);
45
48
49
           
50
46
            //Create a Rectangle that represents the full
51
            //Create a Rectangle that represents the full
47
            //drawable area of the game screen.
52
            //drawable area of the game screen.
48
            viewportRect = new Rectangle(0, 0,
53
            viewportRect = new Rectangle(0, 0,
...
...
59
            }
64
            }
60
        }
65
        }
61
66
67
62
        public bool removeDisplayObject(DisplayObject DO)
68
        public bool removeDisplayObject(DisplayObject DO)
63
        {
69
        {
64
            return Objects.Remove(DO);
70
            return Objects.Remove(DO);
65
        }
71
        }
66
72
73
        public void setBG(string BG)
74
        {
75
            if (background != null)
76
            {
77
                background.Dispose();
78
            }
79
80
            background = game.Content.Load<Texture2D>(BG);
81
        }
82
67
        public void Draw()
83
        public void Draw()
68
        {
84
        {
69
     
85
     
...
...
74
            graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
90
            graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
75
            spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
91
            spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
76
           //spriteBatch.Draw(backgroundTexture, viewportRect,         Color.White);
92
           //spriteBatch.Draw(backgroundTexture, viewportRect,         Color.White);
77
          
93
94
            if (background != null)
95
                spriteBatch.Draw(background, new Rectangle(0, 0, graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height), Color.White);
78
           
96
           
79
             foreach (DisplayObject GO in Objects)
97
             foreach (DisplayObject GO in Objects)
80
            {
98
            {
...
...
91
                            null,
109
                            null,
92
                            Color.White,
110
                            Color.White,
93
                            GO.Rotation,
111
                            GO.Rotation,
94
                            Vector2.Zero, 1.0f,
112
                            GO.Shift, GO.scale,
95
                            SpriteEffects.None, 0);
113
                            SpriteEffects.None, 0);
96
                    }
114
                    }
97
                }
115
                }
...
...
102
                    {
120
                    {
103
                        spriteBatch.Draw(TextureToDraw,
121
                        spriteBatch.Draw(TextureToDraw,
104
                        GO.Position,
122
                        GO.Position,
105
                        null,
123
                       null ,
106
                        Color.White,
124
                        Color.White,
107
                        GO.Rotation,
125
                        GO.Rotation,
108
                        Vector2.Zero, 1.0f,
126
                        GO.Shift, GO.scale,
109
                        SpriteEffects.None, 0);
127
                        SpriteEffects.None, 0);
110
                    }
128
                    }
111
                    spriteBatch.DrawString(game.Font1, ((DisplayText)GO).Text, GO.Position, ((DisplayText)GO).TextColor,
129
                    spriteBatch.DrawString(game.Font1, ((DisplayText)GO).Text, GO.Position, ((DisplayText)GO).TextColor,
112
            GO.Rotation, Vector2.Zero, 1.0f, SpriteEffects.None, 0.5f);
130
            GO.Rotation, GO.Shift, 1.0f, SpriteEffects.None, 0.5f);
113
                    
131
                    
114
                }
132
                }
115
             }
133
             }

Updated RPG/DisplayObject.cs Download diff

1920
10
10
11
namespace RPG
11
namespace RPG
12
{
12
{
13
    class DisplayObject
13
    public class DisplayObject
14
    {
14
    {
15
        public Dictionary<String, Texture2D> SpriteList;
15
        public Dictionary<String, Texture2D> SpriteList;
16
        protected String SpriteToUse;
16
        protected String SpriteToUse;
17
        public Vector2 Position;
17
        public Vector2 Position;
18
        public float Rotation;
18
        public float Rotation;
19
        public Vector2 Center;
19
        public Vector2 Shift;
20
20
21
        public float scale;
21
22
22
23
23
        public DisplayObject()
24
        public DisplayObject()
...
...
25
            Rotation = 0.0f;
26
            Rotation = 0.0f;
26
            Position = Vector2.Zero;
27
            Position = Vector2.Zero;
27
            SpriteList = new Dictionary<string, Texture2D>();
28
            SpriteList = new Dictionary<string, Texture2D>();
28
            Center = Vector2.Zero;
29
            Shift = Vector2.Zero;
30
            scale = 1;
29
        }
31
        }
30
        public DisplayObject(Texture2D loadedTexture)
32
        public DisplayObject(Texture2D loadedTexture)
31
        {
33
        {
...
...
33
            Position = Vector2.Zero;
35
            Position = Vector2.Zero;
34
            SpriteList = new Dictionary<string, Texture2D>();
36
            SpriteList = new Dictionary<string, Texture2D>();
35
            SpriteList["Default"]= loadedTexture;
37
            SpriteList["Default"]= loadedTexture;
38
            scale = 1;
39
            
36
            SpriteToUse = "Default";
40
            SpriteToUse = "Default";
37
            Center = new Vector2( loadedTexture.Width / 2, loadedTexture.Height / 2);
41
            Shift = Vector2.Zero;
38
        }
42
        }
39
43
44
        public void setShift(Vector2 newShift)
45
        {
46
            Shift= newShift;
47
        }
48
40
        public int addSprite(Texture2D NewSprite, String SpriteName)
49
        public int addSprite(Texture2D NewSprite, String SpriteName)
41
        {
50
        {
42
            if (NewSprite != null && SpriteName != null)
51
            if (NewSprite != null && SpriteName != null)
...
...
126
            Font = font;
135
            Font = font;
127
            TextColor = Color.Lime;
136
            TextColor = Color.Lime;
128
            SpriteList = null;
137
            SpriteList = null;
129
            Center = new Vector2 ( Font.MeasureString(S).X/2 , Font.MeasureString(S).Y /2);
138
            Shift = new Vector2 ( Font.MeasureString(S).X/2 , Font.MeasureString(S).Y /2);
130
139
131
        }
140
        }
132
141
...
...
141
            SpriteList["Default"] = loadedTexture;
150
            SpriteList["Default"] = loadedTexture;
142
            SpriteToUse = "Default";
151
            SpriteToUse = "Default";
143
            
152
            
144
            Center = new Vector2(Math.Max(loadedTexture.Width / 2, Font.MeasureString(S).X), Math.Max(Font.MeasureString(S).Y, loadedTexture.Height / 2));
153
            Shift = new Vector2(Math.Max(loadedTexture.Width / 2, Font.MeasureString(S).X), Math.Max(Font.MeasureString(S).Y, loadedTexture.Height / 2));
145
        
154
        
146
155
147
        }
156
        }

Updated RPG/Game1.cs Download diff

1920
46
        GameStates GameState;
46
        GameStates GameState;
47
        string output;
47
        string output;
48
        Random rand;
48
        Random rand;
49
        Carte MaCarte;
50
        Character MyCharacter;
51
52
        GameMotor GM;
53
49
        public Game1()
54
        public Game1()
50
        {
55
        {
51
           /*
56
           /*
...
...
89
94
90
            //DisplayObject balle2 = new DisplayObject(Content.Load<Texture2D>("e"));
95
            //DisplayObject balle2 = new DisplayObject(Content.Load<Texture2D>("e"));
91
96
92
           DisplayObject perso= new DisplayObject(Content.Load<Texture2D>("perso"));
97
           DisplayObject perso= new DisplayObject(Content.Load<Texture2D>("Basketball"));
93
    
98
            
94
           DisplayObject balle2 = new DisplayText("Hello World", Font1);
99
           MyCharacter= new Character(perso, display);
100
           MyCharacter.setVisible(true);
101
102
           MaCarte = new Carte("background", display );
103
           MaCarte.Cases[0, 0].wall[(int)Directions.RIGHT] = true;
104
105
           MaCarte.setActive();
106
107
           GM = new GameMotor(this, MyCharacter, MaCarte);
108
109
            /*
110
             DisplayObject balle2 = new DisplayText("Hello World", Font1);
95
            balle2.Position = new Vector2(display.viewportRect.Width/3, display.viewportRect.Height/3);
111
            balle2.Position = new Vector2(display.viewportRect.Width/3, display.viewportRect.Height/3);
96
97
            balle = new GameObject(balle2, display);
112
            balle = new GameObject(balle2, display);
98
99
            balle.setVisible(true);
113
            balle.setVisible(true);
100
101
            Infos = new DisplayText("Init", Font1);
114
            Infos = new DisplayText("Init", Font1);
102
            Vector2 FontPos = new Vector2(50,
115
            Vector2 FontPos = new Vector2(50,
103
            display.graphics.GraphicsDevice.Viewport.Height - 100);
116
            display.graphics.GraphicsDevice.Viewport.Height - 100);
104
            Infos.Position = FontPos;
117
            Infos.Position = FontPos;
105
            display.addDisplayObject(Infos);
118
            display.addDisplayObject(Infos);
119
             */
106
120
107
        
121
           Infos = new DisplayText("Init", Font1);
122
           Vector2 FontPos = new Vector2(50,
123
           display.graphics.GraphicsDevice.Viewport.Height - 100);
124
           Infos.Position = FontPos;
125
           display.addDisplayObject(Infos);
108
126
109
            base.LoadContent();
127
            base.LoadContent();
110
        }
128
        }
...
...
132
150
133
151
134
            // Needed for keyboard events
152
            // Needed for keyboard events
135
            float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;
153
           
136
            TotalElapsedTime += elapsed;
137
           // KeyboardState ks= Keyboard.GetState();
154
           // KeyboardState ks= Keyboard.GetState();
138
            KeyboardState keyboardState = Keyboard.GetState();
155
            KeyboardState keyboardState = Keyboard.GetState();
139
            MouseState mouseState = Mouse.GetState();
156
            MouseState mouseState = Mouse.GetState();
140
157
158
159
            GM.update(gameTime);
160
161
            Infos.Text = MyCharacter.step.ToString();
162
163
            /*
141
            // Normal game loop
164
            // Normal game loop
142
            if (GameState == GameStates.Normal)
165
            if (GameState == GameStates.Normal)
143
            {
166
            {
...
...
183
                        balle.acceleration = new Vector2(0.0f, 0.0f);
206
                        balle.acceleration = new Vector2(0.0f, 0.0f);
184
                    }
207
                    }
185
                }
208
                }
209
             */
186
                
210
                
187
                /*
211
                /*
188
                double ANorm = Math.Sqrt((float)Math.Pow(mouseState.X - balle.DO.Position.X , 2)+(float)Math.Pow(mouseState.Y - balle.DO.Position.Y, 2) );
212
                double ANorm = Math.Sqrt((float)Math.Pow(mouseState.X - balle.DO.Position.X , 2)+(float)Math.Pow(mouseState.Y - balle.DO.Position.Y, 2) );
...
...
190
               double newAy = (mouseState.Y - balle.DO.Position.Y) / Math.Pow(ANorm/50, 5);
214
               double newAy = (mouseState.Y - balle.DO.Position.Y) / Math.Pow(ANorm/50, 5);
191
                balle.acceleration = new Vector2((float)newAx, (float)newAy);
215
                balle.acceleration = new Vector2((float)newAx, (float)newAy);
192
                 */
216
                 */
217
            /*
193
                balle.update();
218
                balle.update();
194
219
195
220
...
...
225
250
226
                }
251
                }
227
            }
252
            }
253
             */
228
254
229
255
230
          
256
          

Updated RPG/GameMotor.cs Download diff

1920
3
using System.Linq;
3
using System.Linq;
4
using System.Text;
4
using System.Text;
5
using Microsoft.Xna.Framework;
5
using Microsoft.Xna.Framework;
6
using Microsoft.Xna.Framework.Input;
6
7
7
namespace RPG
8
namespace RPG
8
{
9
{
9
    public class GameMotor
10
    public class GameMotor
10
    {
11
    {
11
        Character Ch;
12
        Character Ch;
12
        Carte C;       
13
        Carte C;
13
        GameTime LastUpdate;
14
        Game game;
15
        float time;
14
16
15
    public GameMotor (GameTime G, Character newCh, Carte newC)
17
    public GameMotor (Game G, Character newCh, Carte newC)
16
	{
18
	{
17
       LastUpdate= G;
19
        game = G;
18
       Ch = newCh;
20
        Ch = newCh;
19
       newC = C;
21
        C = newC;
22
        time = 0;
20
    }
23
    }
21
24
22
    void update()
25
    public void update(GameTime gametime)
23
    {
26
    {
24
        if (KeyboardState.IsKeyDown(Keys.Right) && C.Case.GO != null){        
27
        float elapsed = (float)gametime.ElapsedGameTime.TotalSeconds;
25
            Ch.Move("right");
28
        time += elapsed;
26
            };      
29
   
27
        if (KeyboardState.IsKeyDown(Keys.Left)){
30
        KeyboardState keyboardState = Keyboard.GetState();
28
            Ch.Move("left");
31
32
        if (time > 0.1f)
33
        {
34
            time = 0;
35
            if (keyboardState.IsKeyDown(Keys.Right) && Ch.Coord[0] < Globals.NB_CASES_X - 1)
36
            {
37
                if(!C.Cases[Ch.Coord[0],Ch.Coord[1]].wall[(int)Directions.RIGHT])
38
                Ch.move("Right");
39
29
            };
40
            };
30
        if (KeyboardState.IsKeyDown(Keys.Up)){
41
            if (keyboardState.IsKeyDown(Keys.Left) && Ch.Coord[0] > 0)
31
            Ch.Move("up");
42
            {
43
                if (!C.Cases[Ch.Coord[0], Ch.Coord[1]].wall[(int)Directions.LEFT])
44
                Ch.move("Left");
32
            };
45
            };
33
        if (KeyboardState.IsKeyDown(Keys.Down)){
46
            if (keyboardState.IsKeyDown(Keys.Up) && Ch.Coord[1] > 0)
34
            Ch.Move("down");
47
            {
48
                if (!C.Cases[Ch.Coord[0], Ch.Coord[1]].wall[(int)Directions.UP])
49
                Ch.move("Up");
35
            };
50
            };
51
            if (keyboardState.IsKeyDown(Keys.Down) && Ch.Coord[1] < Globals.NB_CASES_Y - 1)
52
            {
53
                if (!C.Cases[Ch.Coord[0], Ch.Coord[1]].wall[(int)Directions.DOWN])
54
                Ch.move("Down");
55
            };
56
        }
57
        else
58
        {
59
            Ch.update();
60
        }
36
    }
61
    }
37
    }
62
    }
38
}
63
}

Updated RPG/GameObject.cs Download diff

1920
6
6
7
namespace RPG
7
namespace RPG
8
{
8
{
9
    class GameObject
9
    public class GameObject
10
    {
10
    {
11
        static Vector2 zero2= new Vector2(0,0);
11
        static Vector2 zero2= new Vector2(0,0);
12
12
...
...
35
            {
35
            {
36
                Dimension = new Vector2(DO.getSprite().Width, DO.getSprite().Height);
36
                Dimension = new Vector2(DO.getSprite().Width, DO.getSprite().Height);
37
            }*/
37
            }*/
38
            Dimension = DO.Center * 2;
38
            Dimension = DO.Shift * 2;
39
        }
39
        }
40
40
41
        public void setVisible(bool V)
41
        public void setVisible(bool V)

Updated RPG/Globals.cs Download diff

1920
5
5
6
namespace RPG
6
namespace RPG
7
{
7
{
8
    class Globals
8
    public enum Directions { LEFT, RIGHT, UP, DOWN };
9
10
    public class Globals
9
    {
11
    {
10
        public static int NB_CASES_X = 16;
12
        public static int NB_CASES_X = 16;
11
        public static int NB_CASES_Y = 12;
13
        public static int NB_CASES_Y = 12;
14
        public static int GAME_WIDTH = 800;
15
        public static int GAME_HEIGHT = 600;
12
16
13
17
18
19
14
    }
20
    }
15
}
21
}

Updated RPG/RPG.csproj Download diff

1920
87
    <Compile Include="Character.cs" />
87
    <Compile Include="Character.cs" />
88
    <Compile Include="Display.cs" />
88
    <Compile Include="Display.cs" />
89
    <Compile Include="DisplayObject.cs" />
89
    <Compile Include="DisplayObject.cs" />
90
    <Compile Include="GameMotor.cs" />
90
    <Compile Include="GameObject.cs" />
91
    <Compile Include="GameObject.cs" />
91
    <Compile Include="Globals.cs" />
92
    <Compile Include="Globals.cs" />
92
    <Compile Include="Properties\AssemblyInfo.cs" />
93
    <Compile Include="Properties\AssemblyInfo.cs" />

Updated RPG/Zone.cs Download diff

1920
9
namespace RPG
9
namespace RPG
10
{
10
{
11
    
11
    
12
	class Zone
12
	public class Zone
13
	{
13
	{
14
		public string Name;
14
		public string Name;
15
		Carte[] Cartes;
15
		Carte[] Cartes;
16
16
17
        public Zone()
17
        public Zone()
18
        {
18
        {
19
            Name= null;
19
            Name = null;
20
            Cartes= null;
20
            Cartes = null;
21
        }
21
22
22
		public int addCarte (Carte C) 
23
		public int addCarte (Carte C) 
23
			/*Ajoute une carte dans la zone.
24
			/*Ajoute une carte dans la zone.
...
...
27
		}
28
		}
28
	}
29
	}
29
30
30
	class Carte
31
	public class Carte
31
	{
32
	{
32
        public string Background;
33
        public string Background;
33
        Case[,] Cases;
34
        public Case[,] Cases;
35
        Display Disp;
34
36
35
        public Carte()
37
        public Carte()
36
        {
38
        {
...
...
45
            }
47
            }
46
        }
48
        }
47
49
48
         public Carte(String Back)
50
         public Carte(String Back, Display D)
49
        {
51
        {
52
             Disp= D;
50
            Background = Back;
53
            Background = Back;
51
            Cases = new Case[Globals.NB_CASES_X,Globals.NB_CASES_Y];
54
            Cases = new Case[Globals.NB_CASES_X,Globals.NB_CASES_Y];
52
            for(int i=0; i<Globals.NB_CASES_X; i++)
55
            for(int i=0; i<Globals.NB_CASES_X; i++)
...
...
58
            }
61
            }
59
        }
62
        }
60
63
64
      public void setActive()
65
      {
66
          Disp.setBG(Background);
67
      }
68
61
        public int put_Object(GameObject Obj, int X, int Y)
69
        public int put_Object(GameObject Obj, int X, int Y)
62
		{
70
		{
63
            if (Cases[X,Y] != null)
71
            if (Cases[X,Y] != null)
...
...
105
		}
113
		}
106
	}
114
	}
107
115
108
	class Case
116
	public class Case
109
	{
117
	{
110
        public string Texture;
118
        public string Texture;
111
        public GameObject GO;
119
        public GameObject GO;
...
...
113
        {
121
        {
114
            GO=null;
122
            GO=null;
115
            Texture=null;
123
            Texture=null;
124
            wall = new bool[4];
125
            for (int i = 0; i < 4; i++)
126
            {
127
                wall[i] = false;
128
            }
129
116
        }
130
        }
117
131
118
		public Case(string T)
132
		public Case(string T)
119
		{
133
		{
120
            GO = null;
134
            GO = null;
121
			Texture=T;
135
			Texture=T;
136
            wall = new bool[4];
137
            for(int i=0; i<4; i++)
138
            {
139
                wall[i]=false;
140
            }
141
122
		}
142
		}
123
143
124
144
125
145
126
		bool[] wall; //Tableau des murs, wall[i]=true s'il y'a un mur sur l'arrĂȘte.
146
        public bool[] wall; //Tableau des murs, wall[i]=true s'il y'a un mur sur l'arrĂȘte.
127
		//wall de taille 4, dans l'ordre : haut, droite, bas, gauche.
147
		//wall de taille 4, dans l'ordre : haut, droite, bas, gauche.
128
	}
148
	}
129
149