Wolfsbane

Members
  • Content Count

    96
  • Joined

  • Last visited

  • Days Won

    1

Wolfsbane last won the day on September 12

Wolfsbane had the most liked content!

About Wolfsbane

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Wolfsbane

    [WIP] Tetris clone

    Just a black screen, nothing loads for me?
  2. Wolfsbane

    Virtual Joystick plugin

    This one. Will be used. 😁 Nice!
  3. Wolfsbane

    Panda Physics Engine: General Chat

    Bad timing, I'm flying out in the morning (have to get up at 3am), and will be travelling for the next 4 days. Now.. if Panda2 only worked on an iPad.... So just some super quick thoughts, I've taken a quick look at it, and.. less code = better code as far as I'm concerned. It feels great, and the code is *much* easier to read, so ++! I've played around for a quick 5 minutes trying to break something, but so far, it's pretty rock solid, so.. hey, I like! I was wondering about this, especially when I saw that there is a var for setting an upper speed limit. I know Delta time-style systems can lose collisions like this, but (if it wasn't caused by my dodgy code), isn't this a bug in the Engine? I can't think of a scenario that we would use this for rectangular collisions? (Unless.. rotated bodies?) Could be useful for the Circle, though. I didn't have luck with this syntax before, so it's good to see, too. The ball body's size has to be halved, of course. (because it's a rectangle, on a massive ball sprite). Now you can sneak the ball in between the bricks, and watch it bobble about. Delicious~
  4. Wolfsbane

    Panda2 on gamefromscratch !

    How're you finding the Godot experience? I took a peek at it when I was looking for my tool, but in the end settled for Panda because it's so lightweight (and effective, which is a very nice combo) Also, it's never too late to join the darkside. 🧛‍♀️
  5. Wolfsbane

    FillColor / FillAlpha Question

    Wait, let me check what I've been drinking. ...water? O.k. no excuses. My bad. But good to know!
  6. Wolfsbane

    FillColor / FillAlpha Question

    Doesn't look like it. I think Graphics are bitmaps, rather than a list of drawing commands, so once it's created, changing what FillColor to use shouldn't affect anything unless you draw to the Graphic again. I haven't though of a way to do colour blending, yet, which I want to to make the particles prettier. For alpha, just making sure you need FillAlpha, or you can just use .alpha?
  7. Wolfsbane

    Panda Physics Engine: General Chat

    Probably my bad. O.k., I've chopped the code down a bit, this might look a bit shorter and cleaner. var collision = false; var xx = this.body.last.x; var yy = this.body.last.y; if ( this.collisionAt(xx+Math.sign(this.body.velocity.x),yy,other)) { this.body.velocity.x *= -1; collision = true; } if ( this.collisionAt(xx,yy+Math.sign(this.body.velocity.y),other)) { this.body.velocity.y *= -1; collision = true; } //...snip So the idea is just: Find where the collision happened (to the right/left, or up/down) and then flip our x/y velocity depending on where that block is. No, I don't touch the current, or last x/y coords, I just flip the x/y velocity.
  8. Wolfsbane

    Panda Physics Engine: General Chat

    Hey, thanks @pstrejczek, That's what I was interested in seeing.. how people are building their various collision systems for their games. also.. I'm part of the group of people who thoughts that you have to pay for PhoneGap eventually. 🙊 Everytime I built my game to test, I was crossing my fingers thinking it'd be the last one. +1 @enpu If you're the guy I think you are, then your video comparing HTML5 game engines actually was the one that introduced me to Panda. I hadn't heard of it before then.
  9. Wolfsbane

    Panda Physics Engine: General Chat

    Just a quick post before I sign off for the night.. but doesn't necessarily need to be solved by the Engine itself. Some problems are o.k. to leave for the developer, as situations can vary from project to project. So my thoughts are I was expecting to see more, say, 'helper' functions that would help a developer solve his specific. I had to calculate the bounding boxes of the two bodies myself.. that doesn't seem fair! This surely must be something every Panda dev has to do. So I'd just expect more helper functions. E.g. We can refactor my breakout code to look like below: collisionAt: function(x,y,other) { var myLeft = x - this.body.shape.width/2; var myRight = x + this.body.shape.width/2; var myUp = y - this.body.shape.height/2; var myDown = y + this.body.shape.height/2; var otherLeft = other.last.x - other.shape.width/2; var otherRight = other.last.x + other.shape.width/2; var otherUp = other.last.y - other.shape.height/2; var otherDown = other.last.y + other.shape.height/2; if ( myRight <= otherLeft) return false; if ( myLeft >= otherRight) return false; if ( myUp >= otherDown) return false; if ( myDown <= otherUp) return false; console.log('1'); return true; }, /** * body is the other object we're colliding with. * dir is.. our direction? * */ collide: function(other, dir) { var collision = false; var xx = this.body.last.x; var yy = this.body.last.y; if ( this.collisionAt(xx+1,yy,other)) { if ( this.body.velocity.x > 0) this.body.velocity.x *= -1; collision = true; console.log('x'); } if ( this.collisionAt(xx-1,yy,other)) { if ( this.body.velocity.x < 0) this.body.velocity.x *= -1; collision = true; console.log('x'); } if ( this.collisionAt(xx,yy-1,other)) { if ( this.body.velocity.y < 0) this.body.velocity.y *= -1; collision = true; } if ( this.collisionAt(xx,yy+1,other)) { if ( this.body.velocity.y > 0 ) this.body.velocity.y *= -1; collision = true; console.log('y'); } if ( collision) other.collide(); if (other.collisionGroup === game.Body.BAT) { console.log('yo'); this.body.velocity.x = (this.body.position.x - other.position.x)*10; } return true; }, (this collisionAt() function obviously doesn't cater for rotated Bodies.. yet, anyway) I'm thinking along these kind of lines? Let the 'Dev' solve his own issue, but just give give them a few more tools to sort it out.
  10. Wolfsbane

    Panda 2 Release notes

    Aha. Spam filter got me. I got it. Perfect-o. I'd been trying to figure out how to do this.
  11. Wolfsbane

    Panda 2 Release notes

    Wait, where is the download link for it? I somehow downloaded the trial version, and have been using that for the past hour, haha.
  12. Wolfsbane

    Panda Physics Engine: General Chat

    hey, I want to make a tutorial series, and I'm tossing up writing a book. Well, I want to write a book, time and commitment permitting. I've already done an example on Minesweeper: Just need my pretty graphics to arrive. I'm not sure about how interested people are in the Panda community for this kind of thing, but I think Javascript games as a whole are getting pretty popular, so it's something I'd like to do. I think I might have something useful to share. But.. enough pimping by me! So for the Arkanoid code: The collision looks messy as heck, but it's kind of necesary because of this example: The ball is colliding with the wall.. but what wall? And where? There are 3 individual wall pieces, and the ball is big enough to bump into all 3 at once. One of them could be an 'UP' collision, because it's technically above the ball, and the other could be a RIGHT collision, etc. Visually, it's clear that it's all gonna be RIGHT collisions, and we should just bounce horizontally off it, but that's not very clear to the physics engine. And, as I mentioned, the built-in collision functions are a bit limited so there's not a 'pretty' way just figure out which block is were, and move accordingly. Instead: Calculate bounding box, and compare values, and then decide how we should bounce. e.g. collide: function(other, dir) { var myLeft = this.body.last.x - this.body.shape.width/2; var myRight = this.body.last.x + this.body.shape.width/2; var myUp = this.body.last.y - this.body.shape.height/2; var myDown = this.body.last.y + this.body.shape.height/2; var otherLeft = other.last.x - other.shape.width/2; var otherRight = other.last.x + other.shape.width/2; var otherUp = other.last.y - other.shape.height/2; var otherDown = other.last.y + other.shape.height/2; var collision = false; //collision box. if ( myUp <= otherDown || myDown >= otherUp ) { if ( myLeft <= otherRight && myRight >= otherLeft) { //vertical bump if ( this.body.position.y < other.position.y ) { if ( this.body.velocity.y > 0 ) { this.body.velocity.y *= -1; collision = true; } } if ( this.body.position.y > other.position.y ) { if ( this.body.velocity.y < 0 ) { this.body.velocity.y *= -1; collision = true; } } } } //collision box. if ( myLeft < otherRight || myRight > otherLeft) { //horizontal bump if ( myUp < otherDown && myDown > otherUp ) { if ( this.body.position.x < other.position.x ) { if ( this.body.velocity.x > 0 ) { this.body.velocity.x *= -1; collision = true; } } if ( this.body.position.x > other.position.x ) { if ( this.body.velocity.x < 0 ) { this.body.velocity.x *= -1; collision = true; } } } } if ( collision) other.collide(); if (other.collisionGroup === game.Body.BAT) { console.log('yo'); this.body.velocity.x = (this.body.position.x - other.position.x)*10; } return true; }, Now: That's a lot of work simply to have a big ball bounce off some little bricks! (I should note: If the wall was a big long brick, we wouldn't have this 'issue'. But hey, I want people to use Tiled to make pretty maps! And it's Arkanoid.. Everything is a little brick!) Edit: Gotta throw out there that I'm not complaining about the Built in Collision engine, just noting I'm finding it a bit featureless. featureless? You mean flexible to create all kinds of different collision systems you say? Yes.. yes I did. 😛 But an FYI nonetheless
  13. Wolfsbane

    Panda 2 Release notes

    Hype! Edit: Wait, I actually have a question: Fixed to use resources folder in settings for icons and splash screens How does this work? @enpu
  14. Wolfsbane

    Panda Physics Engine: General Chat

    Oh, I got the basic collisions working well enough for a decent Arkanoid gameplay. I've attached the source, if anyone wants to take a peak. I'm making it for others to use, or learn how to make games with. (Another reason why I'm wanting to use the built-in physics, as using the built-in physics, as anyone following what I write has to be able to use the trial of Panda to get the 'hook'.) Cough up. 😛 What's the advantage? I'm wrapping something up, too, was just gonna do the default phonegap. breakout_01.zip
  15. Wolfsbane

    Panda Physics Engine: General Chat

    I'll need to get back and keep playing with it, but I think I'm getting a bit confused with the play between the words physics and basic collision detection. I don't really want advanced physics in Panda engine, (I'm satisfied with the P2.js plugin). But I was expecting some more basic collision detection functions. (and as I mentioned, some of the existing functions i.e. circle to rectangle don't really work). So take for instance: the collisionAt(x,y) method. Or take, say, making a top-down shooter, and you want to do somekind of collision between two points check. You'd have to loop through all the bodies in the list, calculate yourself the bounding boxes using the x+width/2, x-width/2, etc, style maths. Now: For most top-down shooters you don't need any kind of advanced Physics systems. It's just left/right, rotate, and blast with collision detection, etc. So I'm curious who's using the built-in physic(collision system) and what they're doing with it. E.g. I saw your platform game template, you had to do some custom collision checking to make the platform dude collide with the walls/roof smoothly. I wanted to make a standard 'bouncing' ball, arkanoid style, and I had to do much the same thing. Calculating the bounding box, checking boundaries, etc. Using a rectangle, because I couldn't quite get a Circle to bounce right off Rectangle. Feels like we could be doing a lot of the same work that could be done in the Engine, so I think there's some room to possibly compare notes, and improve the Engine a little. E.g. I would be thinking to ditch Built-in circles (they don't really work, and if you want that kind of precision, just go P2.js) and just do rectangles, and then pump some useful collision detection methods in there. Also: yeah, @Ninjadoodle, I don't have much experience with physics engines, but I'm pretty agnostic about what is used for advanced physics.