hi,
i would understand the difference between example 1 and example 2 with the usage of "this.posx" and simply "posx"
is it the same ? why in some code i see the usage of this.something ?
//example 1
object_physics = function(game,posx,posy,im,Group){
this.posx=posx
this.posy=posy
Phaser.Sprite.call(this,game,this.posx,this.posy,im)
game.physics.arcade.enable(this)
this.body.velocity.y=10
Group.add(this)
}
object_physics.prototype = Object.create(Phaser.Sprite.prototype)
object_physics.prototype.constructor = object_physics
//example 2
object_physics = function(game,posx,posy,im,Group){
Phaser.Sprite.call(this,game,posx,posy,im)
game.physics.arcade.enable(this)
this.body.velocity.y=10
Group.add(this)
}
object_physics.prototype = Object.create(Phaser.Sprite.prototype)
object_physics.prototype.constructor = object_physics