Jump to content

Tron like grid for units


Nikos123
 Share

Recommended Posts

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...