Popular Content

Showing content with the highest reputation on 05/23/15 in all areas

  1. 1 point
    Update: We are now on Steam Greenlight. Please upvote it and show some support. Good news everyone! The Game Pencil Engine is now Now Available! The Game Pencil Engine features Windows[available now] and Mac+Linux[Coming soon] Editors, 2D Canvas rendering and physics, Tiled and Animation support, strict-mode compliant Javascript scripting, and deploys natively to HTML5, console(s) and desktop. Game Pencil Engine Editor / \ You can now create 2D games with our dynamic editors which place respect on code and components. Currently, we have a sale for developers to get the Game Pencil Engine for 20% off now until July 4, 2016. Download Now
  2. 1 point

    texture atlas sprites

    Sigh. 1. Syntax rules for JS are defined by the ECMA 262 specification, not by this or that minifier. 2. Stripping all linebreaks out of JS code isn't minifying, it's just stripping linebreaks, and it will break some valid JS -- even if semicolons are used. It happens not to break babylon, but that's a result of how babylon is formatted - it's not something that's true of all valid javascript. It's fine that you have a coding style you're happy with, but that's no reason to claim anything else is a syntax error. If you want to understand when semicolons in JS are and aren't required, here is the spec.
  3. 1 point
    That error message makes it sound like your "this.hero" doesn't have a physics body -- that's weird, though, 'cuz I'm assuming you'd see a lot of other weird stuff and not be able to set its velocity. Did you call enable on "this.hero"? Are you sure you have something there that's a Sprite? It sounds like colliding with a platform should assign the jump velocity to your player sprite, so I think you're on the right track there. You won't have to have special "touching" properties; "touching.down" will do it because you'll re-use it for both kinds of platforms.
  4. 1 point

    Making ALL cameras 3D

    You don't need to compress, as both images should be interlaced and end up very close to the same resolution upon display. I don't see where you are rendering every other line and then interpolating to interlaced images. This why they use vertical cameras, so that the camera is easier to manage in the real world. I hope this makes sense.
  5. 1 point

    Dragging Objects In Scene

    Here is my version, works for any mesh: http://www.babylonjs-playground.com/#UTDZF
  6. 1 point

    sprite follow lasso

    What you need to do is set the rotation of the object to be the same as the angle between the object and the vector the object is moving too. You've got the right idea, but there's some problems with your code. getAngle is not a method for sprites, unless you've created that method. If you've defined it elsewhere, make sure that it is returning degrees and not radians as angle is degrees by default (and that's the property you are tweening). Anyway, there really isn't a need to define your own method since Phaser has its own built in that will work for your scenario. You need to get the angle between an object and a vector. Use angleToXY. If your sprites are not physics-enabled, use Phaser.Math.angleBetween with the raw x/y of the sprite and the vector its moving to as the parameters. And you probably want to get and set the angle in radians, not degrees - it's not anymore difficult and has marginal performance benefits. So use the rotation property instead of angle (which is degrees by default). Setting the rotation of the sprite is a less roundabout way of changing the angle. moveToNext: function (sprite, history) { var first = history[0]; if (first == undefined) { return // sprite.kill(); } var time = 2400; var move = this.add.tween(sprite) .to({ rotation : game.physics.arcade.angleToXY(sprite, first.x,first.y) }, 250, 'Power0' , false, 30, 0) .to({ x: first.x, y: first.y, }, time, 'Power0' , false, 30, 0) .start(); move.onComplete.add(function() { history.shift(); return self.moveToNext(sprite, history); }); }A few other notes: you're rotation time should probably be a lot more than 250 milli. That's a super fast tween and (I suspect) you're rotating a small object. If it's 250, why bother tweening at all and just set the rotation without tweening? Also, because you've set an arbitrary time, your sprite will move really fast if the distance is far and really slow if the distance is close. You do want speed to be arbitrary, so you can control how fast the sprite is going but you don't want time to be arbitrary. That is, the time it takes to get to the destination. Remember that time is a product of speed in relation to distance. You have the distance and you can set the speed (because it's arbitrary). So all you need to do is figure out the time with a basic formula: function milliToDistance(distance, speed) { var time = (1000 * distance / speed); return time;}var speed = 60 //this is arbitrary. set it to determine how fast the sprite should tweenvar distance = game.physics.arcade.distanceToXY(sprite, xCoord, yCoord);var time = milliToDistance(distance, speed);That's how you should calculate your time.
  7. 1 point

    HTML5 vs Unity

    It depends entirely on the type of game you're making - Unity is perfect for lots of different things, and its visual editor will let you get something done really quickly. Also it rocks for 3D. If you intend for the game to be playable on the web at the end of it though then forget it. Unless you use the Unity WebGL export (still experimental, still device limited, still massive runtimes) then it won't work - the Unity plugin doesn't work in Chrome any more at all since they disabled NPAPI.
  8. 1 point
    Have you done any work on it that you can show us? Hard getting people to work with you if they have nothing to go on.