Jump to content

jamessimo

Members
  • Posts

    48
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://www.jamessimo.com
  • Twitter
    @james_simo

Profile Information

  • Gender
    Male
  • Location
    Shanghai, China

Recent Profile Visitors

1,530 profile views

jamessimo's Achievements

  1. I am making a large game world like a tile map. The issue I have is my tile map is at least 250x250 tiles (could be 500x500) so if I use var grid = { 'h' : 250, 'w' : 250 }; var tiledGround = new BABYLON.MeshBuilder.CreateTiledGround("Tiled Ground", {xmin: -1, zmin: -1, xmax: 1, zmax: 1, subdivisions: grid}, scene); It crashes Babylonjs or runs at 1FPS if I am lucky However if I use var ground = BABYLON.MeshBuilder.CreateGround("gd", {width: 8000, height: 8000, subdivsions: 250}, scene); it runs just fine, so my plan was to make a ground mesh and loop through each quad or grid[x][y] and apply a material on it depending on what texture I need. Just to give you an idea of what I am doing, I am trying to make a 2d map viewer I made 3D https://jamessimo.itch.io/rimmap My question is how do I do this? I do not have a large single texture I can apply to the whole plane, the textures are applied depending on what a large json file tells it.
  2. Cheers @samme, I think I will have to break up my monster function and break it up into chunks. Would having somthing like this be ok? init(){ loading++ setTimeout(){function(){ //Do massive task loading++; },0} setTimeout(){function(){ //Do another massive task loading++; },100} setTimeout(){function(){ //Do another! another massive task loading++; },200} } update(){ //update UI with var loading }
  3. Hi Adel, I use setPreload sprite when loading all my assets. My issue is not loading assets, its after my game has loaded everything but has a very heavy load function internally (math mathematical calculations and bitmap rendering)
  4. Hey guys, I have made a game that needs to parse and render large save files. The issue I have is that whiles the javascript in Phaser is doing its thing all I can do is show a gif spinner in html whiles the player waits for the game to load. I would like to show a progress bar, I have made a global var that basically ticks up at key intervals in the loading process. The problem is is that the number does increment however the UI in phaser does not update as well as the HTML (in html I just made a update tick and read the loadingProgress var every tick) . I have tested this using debug.text, html span and a phaser ext object. My entire game just locks up when processing stuff but I would like a hook that could be independent and update a number at core intervals.
  5. I am making a level viewer for a game using phaser, I loop through a large array representing the game grid and take the item names from the game save and place them in my phaser world in a loop. I take whatever the game name for the item is and map it to a phaser image, my issue is that I don't want to map every possible item type to an image, if phaser askes for an image that i have not loaded, can I just ignore it without the green texture being plastered over it?
  6. Hey guys, I made a game on my Macbook pro, I use scale.set() in many places and use the screens height/width to help place sprites. The problem is that my Macbook has a retina screen (which has a pixel density of 2.0). When I play my game on a non-retina (normal 1.0) screen the game is blown up to look massive. The way to fix it would be to divide any numbers I use for size/position by the pixel density. This however seems weird as I have to have this everywhere somevar * game.device.pixelRatio Is there a way to do this better?
  7. I think your player movement should be grid/tile based. So you tell the player to go forward 1 tile and the player sprite will LERP towards that sprite so you are not just setting the tile x/y I recommend this because the game will be very frustrating because the player may be 0.001 pixel too close to an explosion and will get killed, if the player moves on a grid they are either Safe or not safe.
  8. Thanks guys, the emitX/Y thing worked, also had a weird bug where I scaled the particle emitter and it caused the position to be incorrect. I am using a weapon @drhayes, Just need a cartoony muzzle flash using particles
  9. Hey guys, I have 2 questions. 1. Why can't a particle emitter follow a sprite using trackSprite? emitter.trackSprite(player, 48, 24); 2. Currently my emitter follows the parent (player) by setting the emitters position on every step as mentioned here http://www.html5gamedevs.com/topic/5549-anchor-emitter-to-sprite/ The problem is that all the particles follows my sprite after it is emitted. I have attached the exact code I used below. I don't want the emitted to share their local coordinates with the emitter after it has been fired. //Called every time my character shoots a weapon. emitter.position.x = player.position.x; emitter.position.y = player.position.y; emitter.start(true, 1000, 500, 1, true);
  10. Been waiting for this for a while! Great work!
  11. Hahah thats great to hear I will push a demo up once my publisher sorts out the iOS and Android releases
  12. Thanks for the feedback! I think I may change the launguge as I think your right about people not wanting to be told what to do!
  13. Hey guys! this is the trailer for my newest game Reach for the Star! It was built using HTML5 Canvas and Javascript with the iioEngine http://iio.js.org/ I have ported it to iOS and Android however I cant share the web build until the iOS and android builds are published. Any feedback on the trailer would be awesome!
  14. So looking at your code I see that you have a global buy bool that gets set if you click the buy button, then it simply maps the buyMesh's X Y to your on mouse move X Y. This is fine inside a Babylon scene but would this not work if your buy button was made with HTML& CSS and lived outside the BABYLON Scene. var onPointerUp = function(evt) { /* THIS WOULD NEVER GET CALLED IF THE BUTTON WAS HTML */ pickResult = scene.pick(evt.clientX, evt.clientY); if (buy) { //.... } else { if (pickResult.hit) { /* THIS WOULD NEVER GET CALLED IF THE BUTTON WAS HTML */ //.... pickedMesh = pickResult.pickedMesh; if (pickedMesh.name == "buyButton") { /* THIS WOULD NEVER GET CALLED IF THE BUTTON WAS HTML */ //Place the mesh over the mouse and set BUY to TRUE } } }}So this solution is not ideal as most html5 game UI is made with either Markup or a canvas object, this implementation requires the BABYLON mouse event to be fired over a mesh (to extract the mouse coords from the event). Would it be better to ignore the onPointerUp function and some how after I click my HTML button to first create the bought object, then some how force the scene.pick(evt.clientX, evt.clientY); On the newly created object? Is this possible? or am I over thinking it? Any feedback would be appreciated!
  15. Hey guys, so im building a tycoon game were you can buy furniture and place it in your house. I have implemented the drag drop system from the playground (http://www.babylonjs-playground.com) and it works for objects which have been placed on the scene. My issue is is that I now want to click a button to BUY an object (mesh) and as soon as I mouse up from the button the mesh would follow my mouse (like the drag and drop) and stop after I click again to place the object. I have tried to expand the drag drop to allow this but in its current implementation it has to have a click/pick event on the mesh I want to move. Has any one expanded the drag drop to work with and without a click event or do I have to make a second set of functions to do this? Cheers for any help you can pass my way.
×
×
  • Create New...