diff --git a/asset/maps/1-1.png b/asset/maps/1-1.png new file mode 100644 index 0000000..7a22846 Binary files /dev/null and b/asset/maps/1-1.png differ diff --git a/asset/maps/map1-1/map-1-platform-part-1-object-pipe.png b/asset/maps/map1-1/map-1-platform-part-1-object-pipe.png new file mode 100644 index 0000000..5bb8e70 Binary files /dev/null and b/asset/maps/map1-1/map-1-platform-part-1-object-pipe.png differ diff --git a/asset/maps/map1-1/map-1-platform-part-1-surface.png b/asset/maps/map1-1/map-1-platform-part-1-surface.png new file mode 100644 index 0000000..74d7bc7 Binary files /dev/null and b/asset/maps/map1-1/map-1-platform-part-1-surface.png differ diff --git a/asset/maps/map1-1/map-1-platform-part-1.png b/asset/maps/map1-1/map-1-platform-part-1.png new file mode 100644 index 0000000..3e3fc3d Binary files /dev/null and b/asset/maps/map1-1/map-1-platform-part-1.png differ diff --git a/asset/maps/map1-1/map-1-platform-part-2.png b/asset/maps/map1-1/map-1-platform-part-2.png new file mode 100644 index 0000000..bea6d68 Binary files /dev/null and b/asset/maps/map1-1/map-1-platform-part-2.png differ diff --git a/asset/maps/map1-1/map-1-platform-part-3.png b/asset/maps/map1-1/map-1-platform-part-3.png new file mode 100644 index 0000000..88d8fea Binary files /dev/null and b/asset/maps/map1-1/map-1-platform-part-3.png differ diff --git a/asset/maps/map1-1/map-1-platform-part-4.png b/asset/maps/map1-1/map-1-platform-part-4.png new file mode 100644 index 0000000..66a6580 Binary files /dev/null and b/asset/maps/map1-1/map-1-platform-part-4.png differ diff --git a/asset/maps/map1-1/map-1-platform-part-5.png b/asset/maps/map1-1/map-1-platform-part-5.png new file mode 100644 index 0000000..7e357c6 Binary files /dev/null and b/asset/maps/map1-1/map-1-platform-part-5.png differ diff --git a/asset/maps/map1-1/map-1-platform-part-6.png b/asset/maps/map1-1/map-1-platform-part-6.png new file mode 100644 index 0000000..d1deebb Binary files /dev/null and b/asset/maps/map1-1/map-1-platform-part-6.png differ diff --git a/asset/sprites/.gitignore b/asset/sprites/.gitignore deleted file mode 100644 index 25cc06f..0000000 --- a/asset/sprites/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory - -# Except this file -!.gitignore \ No newline at end of file diff --git a/src/index.html b/src/index.html index 90bbe69..ab6758a 100644 --- a/src/index.html +++ b/src/index.html @@ -10,6 +10,7 @@ - + + \ No newline at end of file diff --git a/src/main.js b/src/main.js index e69de29..f75bd76 100644 --- a/src/main.js +++ b/src/main.js @@ -0,0 +1,50 @@ +var config = { + type: Phaser.AUTO, + width: 800, + height: 600, + physics: { + default: 'arcade', + arcade: { + gravity: { y: 300 }, + debug: false + } + }, + scene: { + preload: preload, + create: create, + update: update + } +}; + +var game = new Phaser.Game(config); + +function preload () +{ + this.load.image('bckgrd',"#666666") + this.load.image('platform1','../asset/maps/map1-1/map-1-platform-part-1-surface.png') + this.load.image('platform2','../asset/maps/map1-1/map-1-platform-part-2.png') + this.load.image('platform3','../asset/maps/map1-1/map-1-platform-part-3.png') + this.load.image('platform4','../asset/maps/map1-1/map-1-platform-part-4.png') + this.load.image('platform5','../asset/maps/map1-1/map-1-platform-part-5.png') + this.load.image('platform6','../asset/maps/map1-1/map-1-platform-part-6.png') + this.load.spritesheet('frog-mario','../asset/sprites/mario-frog-layer-1.png',{frameWidth: 35, frameHeight: 39}) + this.load.spritesheet('left-mario','../asset/sprites/mario-frog-walk-right.png',{frameWidth: 32, frameHeight: 39}) +} + +function create () +{ + platforms = this.physics.add.staticGroup() + + platforms.create(600, 575, 'platform1'); + + player = this.physics.add.sprite(100, 130, 'frog-mario').setDisplaySize(100, 100); + player.setBounce(0.1); + player.setCollideWorldBounds(true); + + this.physics.add.collider(player,platforms) +} + +function update (){ + +} +