Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

466 Neutral

About jakson15

  • Rank
  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?
  4. 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! :)
  5. 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"?
  6. 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? 
  7. Before I speak I'd just like to tell you about my past.   For me programming started when I was about 13 or so, but it wasn't really programming but scripting for the Warcraft 3 game. I really enjoyed the game and decided to learn how to make maps using their editor, it wasn't long before I discovered the two different types of coding the maps, the graphical interface and the typing environment. I learnt quite a lot for my age about how classes, functions, variables, using ready made functions (sin/cos, atan2 e.t.c) worked and it really had an impact on me.   A few years later I found that you can make games on the xbox with Microsoft's XNA with C# and learnt that as my first programming language, I never really made anything amazing with it apart from moving basic objects around and I realised programming at age 15 would take more time and effort to get me anywhere. I ended up not really learning much about C# despite it being a 'simple' language to understand and instead made a massive mistake.   That mistake was me learning C++.   At first it was hard to grasp any concepts that C++ had to offer. What is a pointer!? Include? Namespace... ?   But as time went on I understood the basics of a C++ console program (I thought to myself maybe it wasn't a massive mistake after all... ), and began to make just small applications such as basic text games. This was amusing but it irked me that I could only make text games, so I searched the web and found SDL, luckily I came across LazyFoo's website which helped me set it up and gave a lot of explanation on how SDL worked. I learned to make basic windows in C++ which could render images.   Now we come to the present.   I am a 19 year old University student in my second year of studying computer science, I really enjoy this course as it will hopefully help me get into software development (hopefully games, but you just have to be grateful for what you're given right?). From using SDL I have made games such as Tetris, Astroids, Snake, basic platformers and other tiling 'systems' (but not really systems, just tests to see what works, if you get me?).   My current project is to just get a basic RPG which I can build onto in the future, I know it is seems like a daunting project for a single person, but I want to devote time to it and just understand RPG concepts and have this type of game 'under my belt'.   I have been browsing gamedev.net for ages and I read many posts per day, they are all inspiring and I love seeing the work and progress that others like me are making.   My current problem.   As I've been developing my problems are about structuring my code / files and circular dependencies.   Structuring my code   As I am using C++ I have headers and source files, this leads to quite a lot of files and I'm curious if there is any special way people organise their files in a project?  Like sub folders for files? or Special naming conventions for things that are alike?   Circular dependencies   This is a joined problem with structuring my code, as I am in the process of making an RPG (albeit basic) I occasionally have thoughts on what I will do when I come to coding things.  People say that circular dependencies are mostly unnecessary and can be avoided, I would like some help on trying to understand this for my project.     What is the best way to structure a Map having Player and NPC objects?   Should the Map have references to Player / NPC's or should it be the other way around? Should they all have references to each other? Should a Map have positions of all objects on it? Or should the objects store their own positions?   Maybe I have my classes structured wrong, but this is what this site is for right? Insight, Knowledge, Feedback and Help!   Sorry for the long post about my life but it just felt right giving some background, and to show that I'm not just jumping into something way over my head. Thank you for reading this and hopefully sharing your wisdom with me!   
  8. jakson15

    Tic tac toe on 5x5 board

    Tic Tac Toe wouldn't work properly as a 3 in a row on a 5x5 grid. The first will always win if they place a piece in the center or the middle ring. No matter where the second person goes the first person will be able to place a piece on the center/middle ring, the second person has two options to block, and the first person wins on the third go. A 4 in a row on a 5x5 grid may be a little harder but the first person will always be in the lead as the second person will have to block every single turn instead of trying to score a 4 in a row.   5 in a row, will end in more stalemates as there are more places for each other to block and only 12 ways to win.
  • 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!