• Content Count

  • Joined

  • Last visited

Everything posted by jamessimo

  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.
  16. Cheers, I thought of doing this but wanted to check to make sure that there wasn't an automated system to do it, am I correct in saying that setting the blender shading mode doesn't translate into your exported .babylon file?
  17. Hey guys, I have made a basic scene in blender with some lights and textures. I have set the shading to FLAT in blender however the scene in babylonjs is smooth, I know for individual meshes I can use the convertToFlatShadedMesh() function but that doesn't seem to work on a scene object. My question is, is there a way to make the whole scene use flat shading? I don't want the scene to be smooth shaded and I cant find a way to set this in the scene api.
  18. So that's quite a list you have made of features you will need. For any game that wants to go online multiplayer I would focus on making a core game first then look into making it online. https://github.com/huytd/agar.io-clone/wiki/Game-Architecture This is a good example of how a game and server communicate.
  19. This is really rad, love what you are doing with webGL, runs like a dream.
  20. This is brilliant, i was thinking of adding an update function to the salesman OBJ. But does this have negative implications if say I have a lot of sales men and other similar objects who need to be iterated over? Or is this just a reality of game development? Again thanks a ton, this has got me on the right track.
  21. Hey guys, I have a question about game loops for large games in javascript. I am making a tycoon style game where at any time I can have many Sales Men who are working simultaneously. This means they all need to have accsess to the GAMELOOP at any given time. I have provided pseudo code on how I currently do this, however this feels messy. The code is simply, making two Sales Men, setting there current task with the assignJob function, then the loop will detect their Job and add to there profit. Is there a better way to do this (inside the step function)? init();//Set JobsassignJob(SalesMen[0], 'Door to Door Vacuum salesman');assignJob(SalesMen[1], 'Door to Door Ironing Board salesman');function init(){ //Set up SalesMan SalesMen = [ {id: 1, name: 'example1', job: false,profit: $0.00}, {id: 2, name: 'example2', job: false,profit: $0.00}, ]; step();}function assignJob(salesMan,jobType){ salesMan.job = jobType;}function step(){ //HERE IS THE ISSUE - THIS FEELS WRONG for(var i = 0 ; i < SalesMen.length ; i++){ if(SalesMen[i].job){ SalesMen[i].profit += 0.10; } } //LOOP GAME step();} (fyi I also had a version where each function that needed a loop would just loop internally, I removed this as I know having n-nunber of loops is bad)
  22. Brilliant game, I love seeing polished HTML5 games. A few things I would like to see is; A WASD option for controls.The jumping / platforming is ok, but some platforms I felt were too small and when I jump I felt like I wasn't in full control.The brambles that hurt you really need to be better shown, I had a few frustrating deaths because I couldn't make them out.Apart from that it is a great game and hopefully it helps teach kids about aboriginal culture PS I love the boomerang mechanics.
  23. I too got the Cannot read property 'x' of undefined' Apart from that my only real gripe with the game is that it looks very bad on retina screens, you may want to look into detecting pixel ratios and upscaling accordantly. Still a nice game!
  24. I had this issue too with on of my games, if I was you I would invest in making a level editor, it really speeds up development and testing whiles learning a lot about development. Played the game too, I like the concept but I think using the keyboard makes it too easy, I would look into using a mouse or touch screen, that would add a layer of dexterity that would really add to the fun!
  25. I don't really think this looks good, why are some models are bump mapped and others not? Why is the scene lighting all over the place? Why are the texture resolutions all different. There is no consistency, it feels like this was made with a bunch of different models taken from the Internet. You need to render this as a whole scene with a single light source and add shadows to all models. This will also brighten up the scene if you make every thing inherit the same lighting. Lastly, texture everything, it's very glaring if one object has no texture and others do.