Merge branch 'particlesBranch' of https://github.com/progtime-net/DangerousD into particlesBranch
This commit is contained in:
commit
4f54d25f34
8 changed files with 133 additions and 0 deletions
1
DangerousD/Content/animations/GibsMoveLeftBottom
Normal file
1
DangerousD/Content/animations/GibsMoveLeftBottom
Normal file
|
@ -0,0 +1 @@
|
|||
{"id":"GibsMoveLeftBottom","textureName":"MonstersAnimations","startSpriteRectangle":{"X":70,"Y":724,"Width":14,"Height":11},"frameSecond":[{"Item1":0,"Item2":6}],"textureFrameInterval":1,"framesCount":2,"isCycle":true,"offset":"0, 0"}
|
1
DangerousD/Content/animations/GibsMoveLeftTop
Normal file
1
DangerousD/Content/animations/GibsMoveLeftTop
Normal file
|
@ -0,0 +1 @@
|
|||
{"id":"GibsMoveLeftTop","textureName":"MonstersAnimations","startSpriteRectangle":{"X":2,"Y":721,"Width":14,"Height":12},"frameSecond":[{"Item1":0,"Item2":8}],"textureFrameInterval":1,"framesCount":2,"isCycle":true,"offset":"0, 0"}
|
1
DangerousD/Content/animations/GibsMoveRightBottom
Normal file
1
DangerousD/Content/animations/GibsMoveRightBottom
Normal file
|
@ -0,0 +1 @@
|
|||
{"id":"GibsMoveRightBottom","textureName":"MonstersAnimations","startSpriteRectangle":{"X":106,"Y":722,"Width":13,"Height":12},"frameSecond":[{"Item1":0,"Item2":6}],"textureFrameInterval":1,"framesCount":2,"isCycle":true,"offset":"0, 0"}
|
1
DangerousD/Content/animations/GibsMoveRightTop
Normal file
1
DangerousD/Content/animations/GibsMoveRightTop
Normal file
|
@ -0,0 +1 @@
|
|||
{"id":"GibsMoveRightTop","textureName":"MonstersAnimations","startSpriteRectangle":{"X":37,"Y":721,"Width":14,"Height":13},"frameSecond":[{"Item1":0,"Item2":6}],"textureFrameInterval":1,"framesCount":2,"isCycle":true,"offset":"0, 0"}
|
1
DangerousD/Content/animations/GibsNotMove
Normal file
1
DangerousD/Content/animations/GibsNotMove
Normal file
|
@ -0,0 +1 @@
|
|||
{"id":"GibsNotMove","textureName":"MonstersAnimations","startSpriteRectangle":{"X":137,"Y":731,"Width":16,"Height":5},"frameSecond":[{"Item1":0,"Item2":10}],"textureFrameInterval":1,"framesCount":1,"isCycle":true,"offset":"0, 0"}
|
75
DangerousD/Content/map.tmx
Normal file
75
DangerousD/Content/map.tmx
Normal file
|
@ -0,0 +1,75 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.10.2" orientation="orthogonal" renderorder="left-up" width="200" height="200" tilewidth="16" tileheight="16" infinite="1" nextlayerid="5" nextobjectid="5">
|
||||
<tileset firstgid="1" source="../Desktop/DangerousD map/map.tsx"/>
|
||||
<layer id="1" name="Слой тайлов 1" class="StopTile" width="200" height="200">
|
||||
<data encoding="csv">
|
||||
<chunk x="-16" y="0" width="16" height="16">
|
||||
294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,
|
||||
294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294
|
||||
</chunk>
|
||||
<chunk x="0" y="0" width="16" height="16">
|
||||
294,294,294,294,294,321,321,321,321,321,321,321,321,321,321,321,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321,
|
||||
0,321,321,321,321,321,321,321,321,321,0,0,0,0,0,321,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,321,
|
||||
294,294,294,294,321,321,321,321,321,321,321,321,321,321,321,321
|
||||
</chunk>
|
||||
</data>
|
||||
</layer>
|
||||
<objectgroup id="755" name="Zombies" class="LivingEntities.Player" locked="1">
|
||||
<object id="26" x="-50" y="100">
|
||||
<point/>
|
||||
</object>
|
||||
</objectgroup>
|
||||
<objectgroup id="2" name="Слой объектов 1" class="LivingEntities.Monsters.FlameSkull">
|
||||
<object id="1" x="1" y="100">
|
||||
<point/>
|
||||
</object>
|
||||
</objectgroup>
|
||||
<objectgroup id="3" name="Слой объектов 2" class="LivingEntities.Monsters.FrankBalls">
|
||||
<object id="2" x="1" y="100">
|
||||
<point/>
|
||||
</object>
|
||||
</objectgroup>
|
||||
<objectgroup id="4" name="Слой объектов 3" class="LivingEntities.Monsters.Frank">
|
||||
<object id="3" x="-56" y="100">
|
||||
<point/>
|
||||
</object>
|
||||
</objectgroup>
|
||||
<objectgroup id="5" name="Zombies" class="LivingEntities.Monsters.Spider">
|
||||
<object id="4" x="1" y="100">
|
||||
<point/>
|
||||
</object>
|
||||
</objectgroup>
|
||||
<objectgroup id="2" name="Слой объектов 1" class="LivingEntities.Monsters.Slime">
|
||||
<object id="5" x="1" y="100">
|
||||
<point/>
|
||||
</object>
|
||||
</objectgroup>
|
||||
|
||||
</map>
|
|
@ -78,7 +78,13 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
|||
|
||||
public override void Death()
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Particle particle = new Particle(Pos);
|
||||
}
|
||||
|
||||
AppManager.Instance.GameManager.Remove(this);
|
||||
|
||||
}
|
||||
|
||||
public override void Move(GameTime gameTime)
|
||||
|
@ -161,6 +167,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
|||
{
|
||||
monster_health--;
|
||||
GraphicsComponent.StartAnimation("ZombieRightAttack");
|
||||
Particle particle = new Particle(Pos);
|
||||
if (monster_health <= 0)
|
||||
{
|
||||
Death();
|
||||
|
|
46
DangerousD/GameCore/GameObjects/LivingEntities/Particle.cs
Normal file
46
DangerousD/GameCore/GameObjects/LivingEntities/Particle.cs
Normal file
|
@ -0,0 +1,46 @@
|
|||
using DangerousD.GameCore.Graphics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DangerousD.GameCore.GameObjects.LivingEntities
|
||||
{
|
||||
public class Particle : LivingEntity
|
||||
{
|
||||
int delay;
|
||||
public Particle(Vector2 position) : base(position)
|
||||
{
|
||||
Width = 14;
|
||||
Height = 14;
|
||||
Random random = new Random();
|
||||
velocity = new Vector2(random.Next(3, 15), random.Next(3,30));
|
||||
acceleration.Y = 10;
|
||||
delay = 100;
|
||||
|
||||
}
|
||||
|
||||
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "GibsMoveLeftBottom", "GibsMoveLeftTop", "GibsMoveRightBottom", "GibsMoveRightTop" }, "GibsMoveRightTop");
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
delay--;
|
||||
if (velocity.X > 0)
|
||||
{
|
||||
velocity.X--;
|
||||
}
|
||||
if(velocity.Y<=0)
|
||||
{
|
||||
GraphicsComponent.StartAnimation("GipsNoMove");
|
||||
; }
|
||||
if(delay<=0)
|
||||
{
|
||||
AppManager.Instance.GameManager.Remove(this);
|
||||
}
|
||||
base.Update(gameTime);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue