NessEngine

Members
  • Content Count

    11
  • Joined

  • Last visited

  1. nvm It was a problem with the server serving the static files (textures).
  2. So I'm working on my game editor, and I noticed a weird behavior: after I play around with tiles and objects (eg draw different tiles, add trees rock etc. and then delete them, move objects around..), at some point PIXI will get into a state where its no longer able to load new textures. I don't preload all my object's textures, I load only for objects when I need them (if for example I want to put a barrel and don't have its texture loaded yet, I will load the texture especially for the barrel instance). When getting into the stuck mode, all future textures I load will never actually load and always be with valid = false, but no error will appear. I'm loading textures like this: PIXI.Texture.fromImage(texture_name_full, undefined, PIXI.SCALE_MODES.NEAREST); Am I doing something wrong here? Does PIXI have limited amount of textures it can handle? How to address / debug this issue? Thanks!
  3. answering self: looking at PIXI code I saw that when rendering on texture they have these lines: // reset the matrix of the displatyObject.. displayObject.worldTransform.identity(); displayObject.currentBounds = null; that reset the container transformations, but I don't see them updating transform after that. however, later they do: for (i = 0, j = children.length; i < j; ++i) { children[i].updateTransform(); } So what I ended up trying (and it worked): I pushed my container into another empty container, and I rendered the parent container on the texture. This way all transformations apply. This still looks like a bug though. what do you think?
  4. I try to render a container over a renderable texture, but the container transformations simply do not apply on the sprites inside. You can see it happens by taking the following code: var renderer = PIXI.autoDetectRenderer(800, 600,{backgroundColor : 0x1099bb}); document.body.appendChild(renderer.view); // create the root of the scene graph var stage = new PIXI.Container(); // create a new Sprite using the texture var texture = PIXI.Texture.fromImage('_assets/basics/bunny.png'); var bunny = new PIXI.Sprite(texture); // move the sprite to the center of the screen bunny.position.x = 200; bunny.position.y = 150; // create render texture and sprite var render_texture = new PIXI.RenderTexture(renderer, 800, 800); var render_texture_sprite = new PIXI.Sprite(render_texture); stage.addChild (render_texture_sprite); // create a container and add sprite to it var container = new PIXI.Container(); container.addChild(bunny); // these transformations will NOT apply, for some reason.. container.scale.x = 100; container.position.y = 100; // ???? // start animating animate(); function animate() { requestAnimationFrame(animate); render_texture.render(container); renderer.render(stage); } And paste it here http://pixijs.github.io/examples/ Is this a bug? or expected behavior? How do I make the container apply its transformations on the sprite? Thanks!
  5. Well looks like its working. Thanks a lot! EDIT: PS it appears to be working even if I do visible = false, but that's OK for me. (as a test I override this function on a single sprite and not in the prototype, and I see that its keep getting called even after setting its visible to false)
  6. sounds good, but will it always be called? or are there conditions where matrices are stored in cache and it will no longer be calls as long as the sprite remains static? thanks!
  7. Well title pretty much summarize it.. I want to attach a callback that will be called every time a certain sprite is rendered. What's the best (pixi-friendly) way to do it? Looking at the code looks like I could override _renderWebGL and _renderCanvas to first do what I want and then call the original function, but that's kinda ugly. Any ideas? Thanks.
  8. Hi adrigau, thank you for the feedback When I was working on my project I didn't know about sat-js (somehow I missed it in my search), if I did I could use it as a base and build my collision-world logic and simplified API as a wrapper over it. sat-js looks pretty good! I'm using this lib for a (hobby) game I'm working on, but it will take some time until it sees light. its basically a procedurally-generated endless top-down world, which I think is the best use-case for sscd: I totally agree about the tests, its a huge thing currently missing. I should also add some performance tests too. What I find most important to add in next version is convex polygons collision and transformations (scale & rotation), which I feel like critical features. so while at it I might throw in few tests. note: while I don't have convex polygons I do have line-strips, which can make up any shape. but unlike polygons, line strip will only detect collision when crossing the lines and not if tested completely inside the shape. so I feel like polygons are still missing.
  9. Hi all, For one of my projects I wrote a smart & lightweight collision detection lib and decided to publish it. It's not a physical engine, its just the collision part, but made extremely easy and efficient. something like this: var world = new SSCD.World();world.add(new SSCD.Circle(new SSCD.Vector(100, 100), 75));if (world.test_collision(new SSCD.Vector(105, 125))){ alert("Yeah!")}Key features: Collision detection with the following shapes:PointsCirclesRectanglesLinesLine strips (for complex shapes)Composite shapesCollision-World manager to hold and manage all collision shapes.Grid-based optimizations for efficient collision testing.Can easily handle massive worlds with lots of shapes.Collision filters and tags.Built-in debug rendering to show the collision world with all the objects in it (+ camera support).Lightweight minimalistic API. You can get it here: https://github.com/RonenNess/SSCD.js Any feedback / ideas / Etc. will be appreciated thanks,
  10. hi guys, thanks for the feedback! +5 for code exploration it will work in the sandbox but in real battles on the server it runs differently so it won't work. nice idea thought thanks for the feedback. you are right, those functions are too long and annoying, I will change them next time I'll update the code
  11. Hello all, I would like to show my finished web game - NessBots! In this game you design and code a robot (in JavaScript), and send it out to fight challenges and other players. This is a programming game/challenge. You can check it out here: www.nessbots.com you can check it out without registration (a mini-sandbox in the main page), but registering is very simple and easy and don't even require a real email (no confirmation), so please register to have to full experience of creating a bot! I'd love to get some feedbacks and opinions about the game. thanks!