2D Movement

Post your help queries and engine programming questions here

2D Movement

Postby silverplanetside » Mon Mar 30, 2015 9:20 pm

This is the first thing I wanted to try with this engine and after losing 8 hours of my life my character still moves in 2.5D.

This code in ServerNetworkEvents.js will allow me to move in 2D (up, left, down, right), but I'm sure it's not the most elegant solution, and I go crazy just by thinking how many conditionals would I need to move in 2D diagonal too.



Code: Select all
   _onPlayerLeftDown: function (data, clientId) {
      ige.server.players[clientId].playerControl.controls.left = true;
   ige.server.players[clientId].playerControl.controls.down = true;
   },

   _onPlayerLeftUp: function (data, clientId) {
      ige.server.players[clientId].playerControl.controls.left = false;
   ige.server.players[clientId].playerControl.controls.down = false;
   },

   _onPlayerRightDown: function (data, clientId) {
      ige.server.players[clientId].playerControl.controls.right = true;
   ige.server.players[clientId].playerControl.controls.up = true;
   },

   _onPlayerRightUp: function (data, clientId) {
      ige.server.players[clientId].playerControl.controls.right = false;
   ige.server.players[clientId].playerControl.controls.up = false;
   },

   _onPlayerUpDown: function (data, clientId) {
      ige.server.players[clientId].playerControl.controls.up = true;
   

   ige.server.players[clientId].playerControl.controls.left = true;
   },

   _onPlayerUpUp: function (data, clientId) {
   ige.server.players[clientId].playerControl.controls.up = false;
      
   ige.server.players[clientId].playerControl.controls.left= false;



   },
   
   _onPlayerDownDown: function (data, clientId) {
      ige.server.players[clientId].playerControl.controls.right = true;
      ige.server.players[clientId].playerControl.controls.down = true;
   },

   _onPlayerDownUp: function (data, clientId) {
      ige.server.players[clientId].playerControl.controls.right = false;
      ige.server.players[clientId].playerControl.controls.down = false;

   }
};


I've messed with every file placed in "24.4-multiplayer-isometric-keyboard" taking references of "9.3-goto-2d-tiles" mostly to draw the map. Wish there was a "multiplayer-NONisometric-keyboard" folder.
silverplanetside
 
Posts: 1
Joined: Mon Mar 30, 2015 9:13 pm

Re: 2D Movement

Postby robaldred » Tue Mar 31, 2015 11:09 pm

Hello
Have you tried removing this.isometric(true) from Character.js in the example?
I'll try and help and get you a multiplayer non iso tomorrow for you
I don't work for Irrelon. All comments are my own.
I would strongly encourage anyone building production projects with Isogenic to buy a premium licence, it costs very little and will help towards continued development of the engine. Irrelon have spent thousands of hours developing this wonderful platform with many features found in AAA game engine.
User avatar
robaldred
 
Posts: 243
Joined: Wed Oct 23, 2013 8:09 pm
Location: Manchester, England


Return to Help & Questions

Who is online

Users browsing this forum: No registered users and 1 guest
cron