enpu Posted June 11, 2015 Author Share Posted June 11, 2015 @Ninjadoodle You mean something like this?http://ekelokorpi.github.io/panda.js-site/engine/playground/#particle_duration Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted June 11, 2015 Share Posted June 11, 2015 Hi @enpu Awesome! That's exactly what I was looking for Thank you!!! Quote Link to comment Share on other sites More sharing options...
SkyzohKey Posted June 12, 2015 Share Posted June 12, 2015 Panda.JS still doesn't work with Linux + Firefox Quote Link to comment Share on other sites More sharing options...
goide Posted June 13, 2015 Share Posted June 13, 2015 @thanosS in linux if it works with Firefox(Developer Edition) and Chrome. My OS: Elementary Os Freya (Ubuntu 14.04) check the image. https://twitter.com/goide/status/609739344082038784 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted June 15, 2015 Share Posted June 15, 2015 Hi guys Does anyone know, how to switch on the visibility of "HitAreas"? Thank you in advance! Quote Link to comment Share on other sites More sharing options...
enpu Posted June 15, 2015 Author Share Posted June 15, 2015 Just look at the attributes of Debug class.pandaConfig = { debug: { enabled: true, showBodies: true, showBounds: true, showHitAreas: true }}; Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted June 15, 2015 Share Posted June 15, 2015 Hi @enpu Awesome, thanks! I have to get better at looking through the code Quote Link to comment Share on other sites More sharing options...
enpu Posted June 15, 2015 Author Share Posted June 15, 2015 You can also use ?debugdraw in your url to enable all those debug drawings Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted June 15, 2015 Share Posted June 15, 2015 Hi @enpu Is the accelerometer working with 2.0? I tried using this example, but can't seem to get it working http://www.pandajs.net/cheatsheet/620bd114ca91affbd42b.html PS. Just a heads up, I don't think retina etc. is working with the latest dev version. Thank you! Quote Link to comment Share on other sites More sharing options...
enpu Posted June 16, 2015 Author Share Posted June 16, 2015 Just pushed fix, accelerometer should be working now. How is the retina not working?Just tested, and seems to be working as expected for me. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted June 16, 2015 Share Posted June 16, 2015 Hi @enpu Just checked out the accelerometer and it works nicely - thank you! Sorry I think its 'Hires' that doesn't work. If I set it to anything but '1', no graphics load at all (just white screen) Quote Link to comment Share on other sites More sharing options...
enpu Posted June 16, 2015 Author Share Posted June 16, 2015 That's weird, works fine here.Can you give me a working example so i can take a look? Thanks! Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted June 16, 2015 Share Posted June 16, 2015 Hi @enpu Just emailed you a Dropbox link to my current project. I have Hires set to 1 and the graphics load. If I set it to anything else, the don't show. Just for your info, this did not happen in the older dev version I was using. Thank you! Quote Link to comment Share on other sites More sharing options...
enpu Posted June 16, 2015 Author Share Posted June 16, 2015 Thanks, should be working now Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted June 16, 2015 Share Posted June 16, 2015 Awesome, you rock!! PS. I've noticed, that on Cocoon JS the accelerometer seems to work a LOT slower than on the browser (but fps is still 60). Quote Link to comment Share on other sites More sharing options...
enpu Posted June 16, 2015 Author Share Posted June 16, 2015 Thanks for the info, are you using Canvas+ or WebView? Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted June 16, 2015 Share Posted June 16, 2015 Canvas+ Webview+ seems to work fine Quote Link to comment Share on other sites More sharing options...
enpu Posted June 16, 2015 Author Share Posted June 16, 2015 Sounds like a Cocoon issue, will take a look soon.You can try to detect Canvas+ and then maybe multiply the values.if (game.device.cocoonCanvasPlus) { // Do something} Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted June 16, 2015 Share Posted June 16, 2015 All good Thanks again!! Quote Link to comment Share on other sites More sharing options...
oranjoose Posted June 17, 2015 Share Posted June 17, 2015 Hi, if you don't mind, I plan to post a request/suggestion for Panda every now and then. I had trouble choosing whether to put them here or in individual new threads. I guess I'll just put them here for now, as this thread has to do with developing the new version. I can make new threads if that's more appropriate though. Anyways, here's my first suggestion/request for now: One command simple physics switch. Since simple physics (for collisions at least) is pretty common, it might be nice if there was a more straightforward and intuitive way to activate it. For example, maybe when you extend Sprite, along with supplying a value for the texture or interactive property, maybe there could be an autoPhysics boolean property that triggers a lot of the boilerplate statements that maybe the majority of people do for basic physics, i.e. create a body named body, set its position to the position of the sprite, create a rectangle shape the same size as the sprite texture, add the body to the world, remove body when you remove object, etc. This is surely not the best way to do this, but I couldn't help but feel that all these extra steps just to get an object with basic collisions is a bit of a barrier to a beginner. At the same time, I also wouldn't want to start a slippery slope of all sorts of easy toggles all over the place. Just thinking out loud. Quote Link to comment Share on other sites More sharing options...
enpu Posted June 17, 2015 Author Share Posted June 17, 2015 Well you can easily make your own class, like PhysicsSprite, that extends Sprite and does have physics body on it etc. Something like this:game.createClass('PhysicsSprite', 'Sprite', { init: function(texture, x, y) { this.anchorCenter(); var shape = new game.Rectangle(this.width, this.height); this.body = new game.Body(); this.body.position.set(x, y); this.body.addShape(shape); this.update(); }, addTo: function(container) { container.addChild(this); this.body.addTo(game.scene.world); }, remove: function() { this.parent.removeChild(this); this.body.remove(); }, update: function() { this.position.copy(this.body.position); }}); Quote Link to comment Share on other sites More sharing options...
oranjoose Posted June 17, 2015 Share Posted June 17, 2015 Thank you for the quick reply! Yes, creating such a class is very easy for me. I was making the suggestion as a teacher of students just getting into game programming, heck, even just plain old programming. I like how Panda is structured to eliminate a lot of needlessly abstract code, and instead appeals to the average non-programmer's mind. However, with simple physics, there are a lot of statements that in and of themselves are pretty simple, but collectively take a toll on the beginner. To illustrate what I mean, reading bottom up, the beginner probably assumes that the body should automatically stay the same position as the sprite, and therefore position copy is perhaps confusing at first. Of course, you don't necessarily always want a physics body to follow the sprite, but most of the time, I think gamers are conditioned to expect it. Then the idea of removing the body when you are removing the object. I'm guessing the beginner assumes that the garbage collector should automatically remove the body when the object is "removed." Understanding the keyword "this" is already enough of a mind trip for lots of newbies, so the line this.parent.removeChild(this) is particularly taxing on a beginner's mind. I mean, I can go on, but I think you get what I'm at least trying to say. Sure, it's my responsibility as a teacher that the students understand these concepts, but the timing of when these concepts are unrolled is more restricted when they are hit by them before they can make a simple platformer, for example. Thanks for acknowledging my thoughts. It is much appreciated. I completely understand if the suggestion is impractical or outside the style of the engine's structure. Quote Link to comment Share on other sites More sharing options...
PixelPicoSean Posted June 17, 2015 Share Posted June 17, 2015 You can hide those details in the PhysicsSprite code and use this class as the default one, then your students won't see that and can easily understand as you expected Quote Link to comment Share on other sites More sharing options...
oranjoose Posted June 17, 2015 Share Posted June 17, 2015 @PixelPicoSean I suppose you're right. Though I'm trying to avoid as best as I can to create "magic" steps or libraries that are outside of what the students can expect outside the class . But I suppose it can't entirely be helped. Thanks for the suggestion, and thank you enpu for your great work on this engine =). Quote Link to comment Share on other sites More sharing options...
enpu Posted June 17, 2015 Author Share Posted June 17, 2015 @oranjosse I get what you are after for, and i'm trying to make Panda Engine code as clean as possible and easy to understand, but also i'm trying to avoid adding things that are "magically" doing something that you really don't know what is happening. Of course small "helper" functions are welcome. Many classes have small static helper functions, so i was thinking something like game.Body.fromSprite, that would return new body, that has rectangle shape with the dimensions of the sprite. You would use it like this, for example:var sprite = new game.Sprite('panda.png');var body = game.Body.fromSprite(sprite);What do you think? And just out of interest, where are you teaching game programming? 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.