Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added asset/maps/1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added asset/maps/map1-1/map-1-platform-part-1.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 added asset/maps/map1-1/map-1-platform-part-2.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 added asset/maps/map1-1/map-1-platform-part-3.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 added asset/maps/map1-1/map-1-platform-part-4.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 added asset/maps/map1-1/map-1-platform-part-5.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 added asset/maps/map1-1/map-1-platform-part-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions asset/sprites/.gitignore

This file was deleted.

3 changes: 2 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<link rel="stylesheet" type="text/css" href="../vendor/css/style.css">
</head>
<body>


<script src="main.js"></script>
</body>
</html>
50 changes: 50 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -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 (){

}