Skip to content

Commit

Permalink
Display sprites
Browse files Browse the repository at this point in the history
Your pokemon: Charizard
Opponent pokemon: Umbreon
  • Loading branch information
andrewyang96 committed Oct 18, 2015
1 parent f1c1b57 commit 0102944
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
8 changes: 4 additions & 4 deletions appinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
"type": "font"
},
{
"file": "images/umbreon-front",
"name": "IMAGES_UMBREON_FRONT",
"file": "images/charizard-back.png",
"name": "IMAGES_CHARIZARD_BACK_PNG",
"type": "png"
},
{
"file": "images/charizard-back",
"name": "IMAGES_CHARIZARD_BACK",
"file": "images/umbreon-front.png",
"name": "IMAGES_UMBREON_FRONT_PNG",
"type": "png"
},
{
Expand Down
File renamed without changes
File renamed without changes
17 changes: 15 additions & 2 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ var infoRect = new UI.Rect({
backgroundColor: 'white'
});

var yourPokemon = new UI.Image({
image: 'images/charizard-back.png',
position: new Vector2(52, 4),
size: new Vector2(144, 144)
});
battleWind.add(yourPokemon);
var opponentPokemon = new UI.Image({
image: 'images/umbreon-front.png',
position: new Vector2(80, 4),
size: new Vector2(144, 144)
});
battleWind.add(opponentPokemon);

var yourHP = new UI.Rect({
size: new Vector2(52, 5),
position: new Vector2(72, 100),
Expand Down Expand Up @@ -227,7 +240,7 @@ attackMenu.on('click', 'back', function (e) {
});
attackMenu.on('select', function (e) {
// Select attack
infoText.text = "Charizard uses " + e.item.title;
infoText.text("Charizard uses " + e.item.title);
battleWind.show();
});

Expand All @@ -236,7 +249,7 @@ switchMenu.on('click', 'back', function (e) {
});
switchMenu.on('select', function (e) {
// Switch pokemon
infoText.text = "Come back, Charizard! Go " + e.item.title + "!";
infoText.text("Come back, Charizard! Go " + e.item.title + "!");
battleWind.show();
});

Expand Down

0 comments on commit 0102944

Please sign in to comment.