Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


jakson15

Member Since 18 Aug 2013
Offline Last Active Today, 05:33 AM

Topics I've Started

Best way to implement a path system

01 May 2015 - 05:35 AM

So I'm making a web game using HTML5 / Javascript.

I have an Enemy class and would like to know the best way to implement a path system.

I currently have something, but it doesn't seem too efficient for me (Compared to programming I've done in C++).

function Enemy(){
   
   this.currentPath = [];
   
   this.currentPath.push({x: 5, y: 9});
   this.currentPath.push({x: 5, y: 1});
   // e.t.c ...
   this.currentPath.push({x: ..., y: ...}); 

   this.move = function(){
      
      if(atNextNode){
      //Not actual code, but relevant
         this.currentPath.shift();
      }
   };
}

For every enemy I create, I push a whole load of new data into each class.

Compared to C++ where I could just have a pointer to a Path class and then increment where in the path it is, saving memory.

 

I know computing power is very fast but I want to know if there are better ways to implement this sort of thing in JavaScript or I should just not worry about minuscule optimisations like this.


Copying a scene from a movie?

01 May 2015 - 04:04 AM

I'm not at anywhere near the stage of producing something like this, but I was curious as to what the copyright laws are.

 

So, in the movie Fast and Furious 7, there is a scene at the beginning where the 'team' drops cars from a plane with parachutes that land on a mountain and then chase the bad guys.

 

Is that an idea that can be copyrighted?

 

So if I made a game, and then had a mission where you dropped from a plane, the car deploys a parachute and lands and then it plays out like the movie.

Is that protected by the company?

Would someone require permission to create something like that?


[PHP]Understanding how to implement server behavior?

27 December 2014 - 01:24 PM

My inspiration for my server queries and question is my love for poker.

 

So let me start by saying that I'm currently developing a local poker system on my machine. 

Right now I have the basic's down, generating hands, being able to determine best hands e.t.c.

This is all in PHP.

 

What I have started to question is, although I want just a basic system that can simulate a game between 2 players (That would be my machine on 2 different tabs).

I want to understand how to develop a server system for this.

 

My current "idea" of how this all would work, would be:

A "sever" is hosting a current table, waiting for players to join.

Two players join, currency is taken from their "bank" and the server now knows that the table is full and should begin a game.

Things happen in the server such as dishing out cards, allowing players to bet/check/fold e.t.c

At the end of a round one (or more) of the players accrue chips and then the process resets until all but one player remains.

 

I'm not really sure how I would go about processing server commands on a local system or how players would interact.

But I'm just looking for some guidance to get me on the right track.

 

I know I'm not asking for anything easy, but any knowledge would be very helpful right now.

Thank you, for taking time to read this and hopefully help me! :)


Passing information between states?

21 December 2014 - 04:41 PM

So I've been learning about gamestates lately.

Learning from here: http://gamedevgeek.com/tutorials/managing-game-states-in-c/

 

And I get the idea of how you can 'push' new states onto the stack and resume for later, but I'm concerned about passing relative information between them.

 

Say I have a 'menuState' showing available levels and the user clicks 'level1' starting a new state 'gameState'.

How would the gameState I just created know what level to load, and also how would it send data back once I returned to the menu to say "hey, he completed level 1, and can now play level 2"?


increaseStat with negative value or decreaseStat function

27 August 2014 - 04:51 PM

Not really a big deal but I was just wondering what people tend to prefer.

 

So you have a function that can increase a stat, do you pass a negative value or have two separate functions for incr/decr?

 

Programming on my own I feel passing a negative value works just as well.

But would it be questioned if I wrote that code for a company? 


PARTNERS