Jump to content
  • Advertisement

jakson15

Member
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

466 Neutral

About jakson15

  • Rank
    Newbie
  1. jakson15

    Best way to implement a path system

    I have searched passing by reference but I don't quite understand how that should be implemented. Will the Enemy class still have a variable that is the path array?   I think a little example would really benefit me right now, in context of my path trouble and not a generic passing by reference.
  2. 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.
  3. 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?
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!