Skip to content
Snippets Groups Projects
Commit f34df0d0 authored by Samson's avatar Samson
Browse files

alien dick

parent eb0ec92d
No related branches found
No related tags found
No related merge requests found
Pipeline #164006 passed
harkka3/samson/assets/sprites/monster-penis.png

13.9 KiB

harkka3/samson/assets/sprites/penis-barrel.png

2.12 KiB | W: | H:

harkka3/samson/assets/sprites/penis-barrel.png

1.85 KiB | W: | H:

harkka3/samson/assets/sprites/penis-barrel.png
harkka3/samson/assets/sprites/penis-barrel.png
harkka3/samson/assets/sprites/penis-barrel.png
harkka3/samson/assets/sprites/penis-barrel.png
  • 2-up
  • Swipe
  • Onion skin
harkka3/samson/assets/sprites/sperm.png

522 B | W: | H:

harkka3/samson/assets/sprites/sperm.png

561 B | W: | H:

harkka3/samson/assets/sprites/sperm.png
harkka3/samson/assets/sprites/sperm.png
harkka3/samson/assets/sprites/sperm.png
harkka3/samson/assets/sprites/sperm.png
  • 2-up
  • Swipe
  • Onion skin
harkka3/samson/assets/spritesheets/monster-penis-sheet.png

49.4 KiB

demo.state2 = function(){};
var barrel, bullets, velocity = 1000;
var barrel, bullets, velocity = 1000, nextFire = 0, fireRate = 200;
demo.state2.prototype = {
preload: function(){
......@@ -11,14 +11,6 @@ demo.state2.prototype = {
game.stage.backgroundColor = '#0066ff';
addChangeStateEventListeners();
var base = game.add.sprite(centerX, centerY, 'base');
base.anchor.setTo(0.5);
base.scale.setTo(0.4);
barrel = game.add.sprite(centerX, centerY, 'barrel');
barrel.anchor.setTo(0.5, 1);
barrel.scale.setTo(0.5);
bullets = game.add.group();
bullets.enableBody = true;
bullets.physicsBodyType = Phaser.Physics.ARCADE;
......@@ -26,6 +18,17 @@ demo.state2.prototype = {
bullets.setAll('checkWorldBounds', true);
bullets.setAll('outOfBoundsKill', true);
bullets.setAll('anchor.y', 0.5);
bullets.setAll('scale.x', 0.85);
bullets.setAll('scale.y', 0.85);
var base = game.add.sprite(centerX, centerY, 'base');
base.anchor.setTo(0.5);
base.scale.setTo(0.4);
barrel = game.add.sprite(centerX, centerY, 'barrel');
barrel.anchor.setTo(0, 0.5);
barrel.scale.setTo(0.5);
},
update: function(){
barrel.rotation = game.physics.arcade.angleToPointer(barrel);
......@@ -34,11 +37,15 @@ demo.state2.prototype = {
}
},
fire: function() {
console.log('firing');
var bullet = bullets.getFirstDead();
bullet.reset(barrel.x, barrel.y);
if (game.time.now > nextFire) {
nextFire = game.time.now + fireRate;
console.log('firing');
var bullet = bullets.getFirstDead();
bullet.reset(barrel.x, barrel.y);
game.physics.arcade.moveToPointer(bullet, velocity);
bullet.rotation = game.physics.arcade.angleToPointer(bullet);
game.physics.arcade.moveToPointer(bullet, velocity);
bullet.rotation = game.physics.arcade.angleToPointer(bullet);
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.2" tiledversion="1.3.2" orientation="orthogonal" renderorder="right-down" compressionlevel="-1" width="42" height="31" tilewidth="32" tileheight="32" infinite="0" nextlayerid="3" nextobjectid="1">
<tileset firstgid="1" source="rock-tile.tsx"/>
<tileset firstgid="10" source="beach-grass-tile.tsx"/>
<editorsettings>
<export target="assets/tilemaps/beach.json" format="json"/>
</editorsettings>
<tileset firstgid="1" name="rock-tile" tilewidth="32" tileheight="32" tilecount="9" columns="3">
<image source="assets/tilemaps/rock-tile.png" width="96" height="96"/>
</tileset>
<tileset firstgid="10" name="beach-grass-tile" tilewidth="32" tileheight="32" tilecount="2" columns="1">
<image source="assets/tilemaps/beach-grass-tile.png" width="32" height="64"/>
</tileset>
<layer id="1" name="beach" width="42" height="31">
<data encoding="csv">
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment