Cary Crusiau Posted April 11, 2014 Share Posted April 11, 2014 Hi there, In your 'Flying Dog' game, how can I call the plane ('this.sprite' in objects.js file) from a function within the scenes.js file? TIA Quote Link to comment Share on other sites More sharing options...
enpu Posted April 11, 2014 Share Posted April 11, 2014 Do you mean like this:Player = game.Class.extend({ init: function() { this.sprite = new game.Sprite('player.png'); }});SceneGame = game.Scene.extend({ init: function() { this.player = new Player(); this.player.sprite.position.set(200, 200); }}); Quote Link to comment Share on other sites More sharing options...
Cary Crusiau Posted April 11, 2014 Author Share Posted April 11, 2014 Exactly! I already tried 'this.player.sprite' but I didn't know I had to create a new Player(). Thank you very much! Quote Link to comment Share on other sites More sharing options...
Cary Crusiau Posted April 14, 2014 Author Share Posted April 14, 2014 Ok, this create a new instance of the plane. What I want to do is to stop the MovieClip (already created in Player) from SceneGame. Something like this.player.sprite.stop(); TIA Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.