-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
249 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# MagicaVoxel @ Ephtracy | ||
|
||
newmtl palette | ||
illum 1 | ||
Ka 0.000 0.000 0.000 | ||
Kd 1.000 1.000 1.000 | ||
Ks 0.000 0.000 0.000 | ||
map_Kd SandP-Missile.png |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# MagicaVoxel @ Ephtracy | ||
|
||
newmtl palette | ||
illum 1 | ||
Ka 0.000 0.000 0.000 | ||
Kd 1.000 1.000 1.000 | ||
Ks 0.000 0.000 0.000 | ||
map_Kd SandP-PlayerFlame.png |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
using Microsoft.Xna.Framework; | ||
using Microsoft.Xna.Framework.Graphics; | ||
using Microsoft.Xna.Framework.Input; | ||
using Microsoft.Xna.Framework.Audio; | ||
using XnaModel = Microsoft.Xna.Framework.Graphics.Model; | ||
using System.Collections.Generic; | ||
using System; | ||
using Engine; | ||
|
||
namespace Shadow_and_Planet.Entities | ||
{ | ||
using Mod = AModel; | ||
|
||
public class Missile : Mod | ||
{ | ||
PositionedObject TargetRef; | ||
Timer LifeTimer; | ||
|
||
public Missile(Game game, Player player) : base(game) | ||
{ | ||
TargetRef = player; | ||
LifeTimer = new Timer(game); | ||
} | ||
|
||
public override void Initialize() | ||
{ | ||
Active = false; | ||
base.Initialize(); | ||
LoadContent(); | ||
} | ||
|
||
public override void LoadContent() | ||
{ | ||
LoadModel("SandP-Missile"); | ||
BeginRun(); | ||
} | ||
|
||
public override void BeginRun() | ||
{ | ||
|
||
base.BeginRun(); | ||
} | ||
|
||
public override void Update(GameTime gameTime) | ||
{ | ||
if (Active) | ||
{ | ||
RotationVelocity.Z = AimAtTarget(TargetRef.Position, Rotation.Z, MathHelper.PiOver4 *0.25f); | ||
Velocity = SetVelocityFromAngle(Rotation.Z, 200); | ||
|
||
if (LifeTimer.Expired) | ||
{ | ||
Active = false; | ||
} | ||
} | ||
|
||
base.Update(gameTime); | ||
} | ||
|
||
public void Spawn(Vector3 postion, PositionedObject target, float timer) | ||
{ | ||
Active = true; | ||
Position = postion; | ||
TargetRef = target; | ||
LifeTimer.Reset(timer); | ||
} | ||
|
||
void CheckEdge() | ||
{ | ||
if (Position.X > 3000) | ||
Position.X = -3000; | ||
|
||
if (Position.X < -3000) | ||
Position.X = 3000; | ||
|
||
if (Position.Y > 2000) | ||
Position.Y = -2000; | ||
|
||
if (Position.Y < -2000) | ||
Position.Y = 2000; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.