Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

595 Good

About Neophyte

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Neophyte

    Newbie Javascript question

    The problem is right there in the error message: You are calling  this.Update(elapsedMS);   in your this.Tick function, but you have not defined an Update function anywhere.
  2. I've been kind of on the fence about the whole debate over whether or not to test private members, but I'm of the mind that private members are most likely to be small helper functions that are easy to prove that they work, and they require in-class access to test them.   Normally this sort of thinking can work out fine, but since you specifically mentioned Test Driven Development in your first post you should start thinking about tests differently. In TDD a test is not written to prove that something works, it's written to specify how it should work.  A test is, in a manner of speaking, a functional specification written in code.   Once you start thinking about tests as specifications instead of verifications then a lot of the things that initially seem "weird" about TDD makes immediate and intuitive sense (such as why you write the tests before the code, and why the code should not have the minimal functionality required to pass the tests, for instance).   So you should not test private methods. Not because they tend to be small and it is easy to prove that they work (which is often not the case anyway), but because they are not part of the specification of the class, and as such they are merely an implementation detail rather than something that should have  tests written for it.
  3. Neophyte

    The #'th game engine question.

    If you want something like Unreal Engine or Cryengine, then why don't you use Unreal Engine or Cryengine? This may seem like a frivolous question, but these are both available and fit the criteria you have listed, so there must be *something* that makes you not choose these, and telling us what that is will help us answer your question.
  4. It's been a while since I played with OpenGL, so take this with a grain of salt, but glOrtho doesn't require you to use the actual resolution of the screen. That is, your call GL11.glOrtho(0.0D, xRes, 0.0D, yRes, 1.0D, -1.0D); could be replaced with, for instance GL11.glOrtho(0.0D, 1920.0D, 0.0D, 1080.0D, 1.0D, -1.0D); which ought to solve your problem.
  5. Neophyte

    toString() [Java]

    [color=#000088]Use an anonymous inner class, like this public class Tester { public static void main(String [] args) { C cObj = new C() { @Override public String toString() { return "I am C"; } }; B [] bList = { cObj }; for (int i = 0; i < bList.length; i++) { System.out.println( bList.toString() ); } } } [color=#000088]Edit: Fixed whitespace-issues
  6. What makes you think that there being a package named "com" in two different libraries is causing you trouble? I ask because it is certainly not causing you trouble, so if you are having problems it comes from somewhere else, and you have not given information to let us help you solve it.
  7. Neophyte

    Strange Problem with Sprites

    Have you tried making your textures square, and making the sizes a power of two? Older hardware, such as one might find at a school for instance, will frequently have trouble otherwise.
  8. Don't get too hung up on the "component" part of the "Component Object Model" name, it really has nothing to do with components in the sense you're talking about (an Entity/Component design pattern). One of the main reasons for the existence of COM is to facilitate inter-process communication, and as such it has a *lot* of baggage attached to it that is of absolutely no use to you. Baggage both in terms of bloat, and in terms of complexity to work with. You will be much *much* better off implementing your own system.
  9. Neophyte

    Lua DoFile

    Unless you're using some unusual lua VM there is no concurrency. The program does not continue executing until the lua script has loaded, executed and provided a return-value.
  10. Neophyte

    What was I thinking?

    I'm not a PHP-expert (or even novice, to be perfectly honest), but from the looks of it it's testing that the input doesn't contain an apostrophe ("'"), which could be used for SQL-injection.
  11. Neophyte

    programs for...

    That should be <img src="image-location" />
  12. Neophyte

    Maps question

    Well, shouldn't take you more than 20 seconds to test it and find out.
  13. Neophyte

    Help needed with functions

    There are three reasons I'm gonna give you for returning by reference (the second reason is most useful): 1) It's idiomatic in C++ that the assignment-operator returns by reference. 2) Returning by value is sub-optimal. Let's assume for the moment that a Vector has 3 variables: x, y and z. Typically then, the implementation of the assignment-operator will look like this: x = Othervector.x; y = Othervector.y; z = Othervector.z; return *this; In the case where operator= returns by value it will actually return a copy of the vector, rather than the vector "itself", which incurs the extra overhead of making a copy. Returning by reference doesn't do that. 3) There are certain situations where returning by value will make statements that include assignments to behave differently from what would be expected. Unfortunately I could only think of somewhat pathological examples of this, but here goes: // Assumes the existence of a Vector-method something like this: void Vector::setX ( float f ) { x = f; } Vector a, b; // Do stuff that gives b values here (a=b).setX(1.0f); The expected result of this code (other than the immediate firing of the person who wrote it) is that a will have the same values as b, except for the 'x' variable, which will be 1.0 in a. This will hold true if operator= returns by reference. However, if operator= returns by value then 'a=b' will return a copy of a, and it's on this copy that .setX(1.0f) is called. In other words, a isn't changed, but the temporary (and unnamed) copy of a that's returned by 'a=b' has it's x set to 1.0f, and is then thrown away.
  14. If you're using C++ there's no need to use the archaic typedef struct _foo { } foo; idiom, just treat it exactly as you would a class-declaration: struct foo { };
  15. Well, as far as I can tell you have three choices here: a) Retrieve the data by using tons of queries. b) Add a column to the table with a "root_id" containing the id of the node that is at the root of the tree (in addition to a "parent_id" column showing each node's immediate parent), and collect them all in one go using select * from some_silly_table where root_id = node_id_of_the_tree_root c) Switch to a database that supports "CONNECT BY" queries for handling recursive structures (Oracle and PostgreSQL comes to mind)
  • 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!