コード例 #1
0
ファイル: MovingPlattform.cs プロジェクト: JohannaSky/Group-2
 public void CollidePlatform(Plattform plattform)
 {
     if (Hitbox().Intersects(plattform.Hitbox()))
     {
         direction *= -1;
     }
 }
コード例 #2
0
        private void Map()
        {
            for (int i = 0; i < strings.Count; i++)
            {
                for (int j = 0; j < strings[i].Length; j++)

                {
                    if (strings[i][j] == 'P')
                    {
                        Player player = new Player_Jump(playerTex, new Vector2(j * 30, i * 30), 0, 0, new Rectangle(j * 30, i * 30, 30, 30), Window);
                        ObjectList.Add(player);
                    }

                    if (strings[i][j] == 'x')
                    {
                        Plattform plattform = new Plattform(plattformTex, new Vector2(j * 30, i * 30), 0, 0);
                        ObjectList.Add(plattform);
                    }

                    if (strings[i][j] == 'm')
                    {
                        movingPlattform = new MovingPlattform(playerTex, new Vector2(j * 30, i * 30), 0, 0);
                        ObjectList.Add(movingPlattform);
                    }
                }
            }
        }
コード例 #3
0
        private void Map()
        {
            for (int i = 0; i < strings.Count; i++)
            {
                for (int j = 0; j < strings[i].Length; j++)
                {
                    if (strings[i][j] == 'x')
                    {
                        Plattform p = new Plattform(plattformtex, new Vector2(j * 30, i * 30), new Rectangle(j * 30, i * 30, 30, 30));
                        ObjectList.Add(p);
                    }

                    if (strings[i][j] == 'P')
                    {
                        Player P = new Player(playertex, new Vector2(j * 30, i * 30), new Rectangle(j * 30, i * 30, 30, 30));
                        ObjectList.Add(P);
                    }
                }
            }
        }