isagani inofinada469 Points
Adding New Graphics
Brice Roberts18,323 Points
//Load Images in line 83 game.load.image('platform', 'platform_1.png'); game.load.image('platform2', 'platform_2.png');
is where the images are loaded, ready to be called by the game. The part inside the round brackets
could be thought of as saying
var platform = url('platform_1.png');
If you just replace
'platform_1.png' with 'platform_2.png'
you are replacing the image location for "platform" with the image location for "platform2".
You are not loading two separate images that you can load into the game at the same time.
Tom OestermanPro Student 8,889 Points
To expand on Brice's answer,
Isagani, the first function 'game.load.image' loads images that can be used in the game. If you want to use both platform images, you need to have these lines. They are located around line 87 under the comment //Load images
game.load.image('platform', 'platform_1.png'); game.load.image('platform2', 'platform_2.png');
Now when you call the function 'platforms.create()' you can pass either 'platform' or 'platform2' depending on which image you want to appear.
platforms.create(300, 150, 'platform'); platforms.create(450, 300, 'platform2');
This would place the image 'platform_1.png' at position 300, 150, and then image 'platform_2.png' at position 450, 300.
This is why the teacher added the second 'game.load.image' line rather than just replacing the values passed to the function.
Hope this helps.