vmars316 Posted October 8, 2014 Share Posted October 8, 2014 Hello & Thanks;Thought I would just plug in code from http://vermeire.home.xs4all.nl/panda/# But chrome just gives me black image.Logo1.png is in "panda.js-master\media" and "panda.js-master\".Pls, what am I doing wrong?...Thanks <!DOCTYPE html><html><head><meta charset="utf-8"><title>Panda.js HTML5 game engine</title><script type="text/javascript" src="src/game/config.js"></script><script type="text/javascript" src="src/engine/core.js"></script><script type="text/javascript" src="src/game/main.js"></script></head><body>//game.module( 'game.main').require( 'engine.core').body(function(){ game.addAsset('logo1.png'); game.createScene('Main', { init: function() { var logo = new game.Sprite('logo1.png'); //the offset is relative to the center of the screen. Here x:-20, y:10 logo.center(-40,10); this.stage.addChild(logo); } });});</body></html> Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted October 9, 2014 Share Posted October 9, 2014 Hi @vmars316 When you download the Panda source, have a careful look and study how the code is organised into different files. For example your javascript code should be inside main.js or another module and not in you index.html file. Start by editing/playing around with the Panda source you downloaded, to see what the changes you make do. (keep a copy so you can restore if needed). The best way to learn is experimentation / trial and error PS. The code from http://vermeire.home...all.nl/panda/# needs to go inside the main.js file. Quote Link to comment Share on other sites More sharing options...
vmars316 Posted October 9, 2014 Author Share Posted October 9, 2014 Hi @vmars316The best way to learn is experimentation / trial and error PS. The code from http://vermeire.home...all.nl/panda/# needs to go inside the main.js file.Thanks;I finally figured out why doubleClicking on index.html, brought up black-screen and no Panda logo.Turns out, I had two copies of mongoose running. Works as advertised now...vm Quote Link to comment Share on other sites More sharing options...
Stephan Posted October 9, 2014 Share Posted October 9, 2014 Hi vm, I plan to ad many many more examples to the website so it will be a very nice starting point for new developers. (In fact I am already collecting new code fragments at the moment).If you want I can publish the code of the whole fiddler site as a package. It will inculde all images that are necessary to make the examples running. Stephan Quote Link to comment Share on other sites More sharing options...
vmars316 Posted October 9, 2014 Author Share Posted October 9, 2014 Hi vm, If you want I can publish the code of the whole fiddler site as a package. It will inculde all images that are necessary to make the examples running. Stephan Wow Stephan, that sounds great, can't wait..Thanks Quote Link to comment Share on other sites More sharing options...
Stephan Posted October 10, 2014 Share Posted October 10, 2014 Attached you will find the source code of the fiddler site. I just added a new section with fonts, it is included in this download and it is also live available at: http://vermeire.home.xs4all.nl/panda/ If you have code snippets that you would like to include in the flddler, please don't hesitate to send them to me. Stephan fiddler.zip 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.