Fragment sprite

This commit is contained in:
2015-12-07 13:08:33 +01:00
parent 18e807ae42
commit e84352e30a
7 changed files with 8 additions and 3 deletions

View File

@@ -18,11 +18,11 @@ var Particle = function(game, position, image) {
); );
this.Speed = Vec2D.Scale(Vec2D.Normalize({ this.Speed = Vec2D.Scale(Vec2D.Normalize({
X: Math.floor(Math.random() * 33)-16, X: Math.floor(Math.random() * 33)-16,
Y: Math.floor(Math.random() * 33)-16}),32); Y: Math.floor(Math.random() * 33)-16}),48);
}; };
Particle.prototype = { Particle.prototype = {
Update: function() { Update: function() {
this.Speed = Vec2D.Scale(this.Speed, 1.2); this.Speed = Vec2D.Scale(this.Speed, 1.5);
this.GameEntity.AddPosition(this.Speed); this.GameEntity.AddPosition(this.Speed);
if(this.GameEntity.InsideScreen()==false){ if(this.GameEntity.InsideScreen()==false){
this.GameEntity.Delete(); this.GameEntity.Delete();
@@ -64,7 +64,7 @@ CandyEntity.prototype = {
frag = new Particle( frag = new Particle(
this.Game, this.Game,
this.GameEntity.PositionDest, this.GameEntity.PositionDest,
Images.GetImage(this.Color) Images.GetImage("Frags" + this.Color)
); );
this.Game.GameScreen.AddEntity(frag); this.Game.GameScreen.AddEntity(frag);
} }
@@ -126,6 +126,11 @@ CandyFucker.prototype = {
{Name: "Cyan", Url: "gfx/Cyan.png"}, {Name: "Cyan", Url: "gfx/Cyan.png"},
{Name: "Green", Url: "gfx/Green.png"}, {Name: "Green", Url: "gfx/Green.png"},
{Name: "Yellow", Url: "gfx/Yellow.png"}, {Name: "Yellow", Url: "gfx/Yellow.png"},
{Name: "FragsRed", Url: "gfx/FragsRed.png"},
{Name: "FragsBlue", Url: "gfx/FragsBlue.png"},
{Name: "FragsCyan", Url: "gfx/FragsCyan.png"},
{Name: "FragsGreen", Url: "gfx/FragsGreen.png"},
{Name: "FragsYellow", Url: "gfx/FragsYellow.png"},
], ],
function(){ function(){
self.LoadSounds(); self.LoadSounds();

BIN
gfx/Frags.xcf Normal file

Binary file not shown.

BIN
gfx/FragsBlue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
gfx/FragsCyan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
gfx/FragsGreen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
gfx/FragsRed.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
gfx/FragsYellow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB