Nikos123 Posted December 25, 2015 Share Posted December 25, 2015 I would like to have Tron like grid for units, I have extracted the code for this to a class:import Common from "./Common";/** * * The ground (actually a grid in space) that the game sits upon */export default class Ground { mesh:BABYLON.Mesh; click:(e:MouseEvent)=>void; defaultMaterial:BABYLON.StandardMaterial; constructor(scene) { //Creation of a material with wireFrame this.defaultMaterial = new BABYLON.StandardMaterial("wireframe", scene); this.defaultMaterial.wireframe = true; this.mesh = BABYLON.Mesh.CreateGround("ground1", Common.MEDIUM_SIZE_MAP, Common.MEDIUM_SIZE_MAP, 10, scene); this.defaultMaterial = new BABYLON.StandardMaterial("wireframe", scene); this.defaultMaterial.wireframe = true; this.mesh.material = this.defaultMaterial; }}What is the best way to take this forward? Do I need to use a Tiled ground? Currently when panning with this it seems a bit jerky to me. I'm on 2015 mac pro (no GTX card) Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 27, 2015 Share Posted December 27, 2015 Hi Nikos, the main question is - what are you trying to achieve? What you currently use is wireframe. But I guess you are trying to create a tiled ground without the triangles in the middle.There is already a simple tron-like game on babylon.js's main website - http://tronbabylon.azurewebsites.net/ , you might be able to extract some ideas from there. Play around with it and see if it helps you. Quote Link to comment Share on other sites More sharing options...
Nikos123 Posted December 27, 2015 Author Share Posted December 27, 2015 Wow this is perfect, exactly what I want. Basically I want a simple space like static reference for my units movements. My aim is an RTS game with simple graphics and high performance. I'm focusing more on gameplay than graphics. Quote Link to comment Share on other sites More sharing options...
Nikos123 Posted December 27, 2015 Author Share Posted December 27, 2015 Hi Nikos, the main question is - what are you trying to achieve? What you currently use is wireframe. But I guess you are trying to create a tiled ground without the triangles in the middle.There is already a simple tron-like game on babylon.js's main website - http://tronbabylon.azurewebsites.net/ , you might be able to extract some ideas from there. Play around with it and see if it helps you. Is there any source code for it? Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 27, 2015 Share Posted December 27, 2015 Is there any source code for it?Well, this is javascript we are talking about. Ctrl-U would probably be a good start. Just a small note - having the source as JavaScript doesn't mean you can copy the code. You can learn from it, but as this is not an open source project with an open source license, you can't use the source code directly. Please take that into account when looking at the code. Quote Link to comment Share on other sites More sharing options...
Nikos123 Posted December 27, 2015 Author Share Posted December 27, 2015 Ok thanks. Is there a way to go about asking for code reviews? I would like to make sure I'm on the right track with the game once I have basic unit movement. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.