All Activity

This stream auto-updates   

  1. Past hour
  2. Checked already. wheelB is not null and the position is 0,0.
  3. Hi and welcome! Firstly, BJS is a pretty mature library and the devs are quite active about adding missing features - so probably better to do forum searches and whatnot before you consider starting and maintaining a fork. As for main loop timing, yes, you can ignore the default way (engine.runRenderLoop) and do engine.beginFrame() scene.render() engine.endFrame() according to any timing you like. I'm not sure it's actually necessary for your purposes though, since the default behavior drives itself from requestAnimationFrame, which is what you'd probably want to do anyway. Physics is a different matter. As far as I know BJS currently assumes that physics and rendering happen at the same rate - so it ticks the physics engine once per render, and then updates all necessary mesh positions without any interpolation. To decouple them, I think your best be would be to ignore BJS's built-in physics handling and manage your own physics world separately. In this case you'd want to just tick your physics engine at whatever interval, and then add a scene.beforeRender() handler that moves necessary meshes to interpolated positions. (This is what I do in my project, since I'm not using one of BJS's default engines.)
  4. I would suggest using PIXI.Application instead of manually creating the renderer and stage, unless you have a specific reason not to. That will also create a PIXI.ticker.Ticker object which will be used automatically to render the stage every frame at a rate decided by the browser (usually 60 fps). You can then simply add your objects to the stage and they will be rendered every frame. Just change your objects' positions and they will appear where they should. If you want to move your objects smoothly, you will need to move them by a small amount each frame until they reach their destination. I recommend reading about game loops/update functions if you want a better understanding of how this works. Here's a very well-written resource for exactly that (and much more): The update method chapter is what's particularly relevant here, but the game loop one is worth reading even though PIXI.Application (and the browser) mostly handles it. Edit: Oh, and to answer your question: No you shouldn't have to do that. Something more fundamental is wrong which is why I wrote what I did.
  5. Today
  6. o_O, I should have kept my mouse shut maybe...
  7. Hi @enpu First of all, awesome to see you back and I completely understand the reasons behind your absence! At the same time, this makes me quite sad, as I had to move away from Panda in order to get work done (I thought the project was dead). I love your engine and can't wait to see what you do with it. I'll see if I can come back to use Panda for a project or two in the future.
  8. Also this is moving my sprite instantly from spot A to spot B. I'd like to add a movement animation in between (change x and y over time).
  9. I have a number of sprites on the screen. Any time I move one (set the x and y values), I have to remove the sprite from the stage, add the sprite to the stage, and then rerender the stage. Is this normal? Just wondering if I'm doing it right or if there is a more efficient way. Here's my code for moving a sprite: private renderer: PIXI.WebGLRenderer | PIXI.CanvasRenderer; private stage: PIXI.Container; private moveCharacter(sprite: CharacterSprite, hex: PlayfieldHex) { console.log('move at speed! :' + hex.character.speed); this.setSprite(sprite.sprite, hex.row, hex.column); this.stage.removeChild(sprite.sprite); this.stage.addChild(sprite.sprite); this.renderer.render(this.stage); } private setSprite(sprite: PIXI.Sprite, row: number, column: number) { sprite.position.x = this.getX(row, column); sprite.scale.x = this.scale; sprite.position.y = this.getY(row, column); sprite.scale.y = this.scale; }
  10. @letsbrostudio - I hope this doesn't piss too many people off, but WebGPU can bite my sack. Apple has been the biggest nightmare and control freaks I've had to deal with for more than 20 years. They have cost me loads of money and resources trying to play their game strictly by their rules, and I wised up years ago and never looked back. At least @Pryme8 is looking forward to WebCL, which looks promising, but let's not get ahead of ourselves. As for WebGPU, I wouldn't touch this with anothers dev's coding stick. Just my opinion, so please don't hate on me. Although, I still hold complete contempt for Apple and wish they would be willing to join the rest of us and get off their unrealistic Godly high horse; or simply go away. Enough said. DB
  11. @juanmajr93 - Try this - DB
  12. It depends on your requirements. As far as I know, the reason the devs at PIXI left scaling out, is because it really does belong in User-Land, that is it's almost impossible to build a scaling method that fits for 100% of users, devices, rotations, DPR's etc etc. It's really not that hard to implement, at least the way I do it. Break it down into the following: 1. Take care of DPR (shrink stage / canvas by a multiplying factor of window.devicePixelRatio) 2. Calculate differential in scale between art design and current window.innerHeight / window.availHeight / window.clientHeight and apply the smaller of the two point values, the x or the y. 3. Listen out for resize events or device orientation. I tend not to listen for both and calculate the inner width / height as some browsers won't report a device orientation change but rather as a resize. And that's all there is too it. Your stage, and all of it's children will scale to fit correctly. Do not get confused with the way that Phaser does this. Whilst it's very easy to setup, it also causes some issues issues when trying to fit 100% x 100% because of things like the letterbox. It's probably also worth mentioning, that all SVG's and Graphics generated in PIXI take into account of things like DPR. And the resource loader will attempt to load the 2x, 3x etc assets if they are prefixed with this. (mySuperAwesomeSprite@2x.png)
  13. This looks great @NasimiAsl, let me know when I can start using this
  14. Yesterday
  15. I may not be very qualified to answer since I don't know Mysql but here's what I do if I had to communicate with an object to retrieve some values knowing that the response might not be instant. I'd make small quick and fast cache data object - that lives in the code - containing some essential mirrored database entries and which I can access instantly. When the game loads I would update all these cache objects (since now it doesn't matter a couple seconds of delay) and while the game runs I would use them for querying instead of the database. Every now and then (when it's convenient) I would write the cache object entries to the database.
  16. Even if they were considering licensing their IP, cost wouldn't be indie friendly at all. Having original characters is sole path anyway.
  17. @NasimiAsl, Shadows and spot lights do not work on the ground. I gave you an example on the playground. terrain.material.specularColor = new BABYLON.Color3(0.5, 0.5, 0.5); terrain.material.specularPower = 64; do not work also And In fact the lighting has no effect on the ground, so the textures are pale. Thanks
  18. Nice game! And, particularly, nice touch with the old telly frame haha.
  19. ok @dbawel I understand you but I have to use the GearVR environment using the Samsung browser. My application works well if I test it in this browser.However, I would like to add the VR mode like you could see in the video. Maybe, could I get it changing to another type of camera? Today, I can only see my web application in the 2D screen...
  20. @NasimiAsl, I use your ShaderBuilder, and I need advice please: BABYLONX.ShaderBuilder.InitializeEngine(); var terrainMaterial = new BABYLONX.ShaderBuilder() .Map({ path: textureGround }) .Reference(1).Map({ path: 'images/textures/ground_0.png' , uv:'vec2(vuv*10.)' }) .Blue(1, BABYLONX.Helper().Map({ path: 'images/textures/grass_4.jpg' , uv:'vec2(vuv*10.)' }).Build(), {rangeStep:-0.05,rangePower:0.05}) .Red(1, BABYLONX.Helper().Map({ path: 'images/textures/rock_4.jpg' , uv:'vec2(vuv*10.)' }).Build(), {rangeStep:-0.05,rangePower:0.05}) .BuildMaterial(global.scene); terrain.material = terrainMaterial; terrain.material.specularColor = new BABYLON.Color3(0.5, 0.5, 0.5); terrain.material.specularPower = 64; In line 3: .Map({ path: textureGround }) I would like to use a dynamic texture instead of a path. var textureGround = new BABYLON.DynamicTexture("DynamicTexture", 1024, scene, true); var textureSize = textureGround.getSize(); var textureContext = textureGround.getContext(); How can I do ? Thanks
  21. @MrVR - Here is a PG with the camera streaming as a video texture: DB
  22. yeah the analogy is superb
  23. Thank you very much. Moving the game.stage.disableVisibilityChange inside create() worked.
  24. @juanmajr93 - It appears you're working within the Oculus environment as seen in the reference image you provided above. However, the way I work is to avoid plugging in the Samgung phone into the GearVR, and simply launch the browser in landscape mode. I then use a MOGA bluetooth controller to control not only my phone's UI, but also my content or game. This is the fastest and simplest method I've found to develop for multiple devices quicky and efficiently, and then once the game is functioning as desired, it's easy to port to practically any VR device. It simply allows speed and flexability working in this method. DB
  25. When you set the width of a rectangle like that it actually sets its scale to fit instead of reapplying the width. What you should do instead is clear and redraw the rectangle: create: function() { this.timeBarLength = 300; this.timeBar =,0); }, update: function(){ if (this.timeBarLength) this.timeBarLength -= 1; this.timeBar .clear() .lineStyle(5, 0x0000FF, 90) .beginFill(0x00FF00) .drawRect(30, 60, this.timeBarLength, 30) .endFill() }
  26. suggest some kinda intro or help screen. First click I had no idea what to do. After the second click I knew though
  27. Don't do that, Phaser makes the Stage for you. Move the rest into create: game = new Phaser.Game(1000, 600, Phaser.AUTO, 'gameCanvas', {preload: preload, create: create, update: update}, false, false); function init() { game.stage.disableVisibilityChange = true; // … } You can keep using game.add.sprite.
  1. Load more activity