Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

334 Neutral

About JohnHurt

  • Rank
  1. JohnHurt

    For you who wants more time for your projects!

    I'd say that the topic behind this thread is a rather good case study for the benefits of going outside and doing other things every now and then. ;)
  2. Been a while since I did any MFC but if I remember correctly you implement the OnIdle() method in your App (or Doc or View, not sure which) and stick your rendering loop in there. OnIdle should get called whenever there is spare CPU time available, so should work pretty much all the time ;)
  3. JohnHurt

    2D parallax...

    Rather than passing in the layer system to the renderer, I would do it the other way round. Renderers shouldn't really need to know about high level scenegraph details, they just draw stuff ;) Think what would happen if you wanted to re-use your renderer for another project that didn't have the same type of scene management.
  4. JohnHurt

    2D parallax...

    In my 2D engine (which is a while ago now), I had a scene manager which kept tiles and objects in seperate layers. These layers could be moved, updated and rendered seperately. To set the scroll speed of each layer you just set a "scroll factor" for it, which is basically just a number you multiply the current camera position by. So a layer with a factor of 1 will move at normal speed, 0.5 will move half as fast, 0 will be stationary etc. You could also have layers in front move faster, and also get layers to move the opposite way if you want to. With a bit of extra work you could also have layers auto-scroll, that way you can simulate clouds moving past in the background.
  5. not sure I understand this line: if (((sp.Angle - target_angle)) > Math.PI) should you not replace Math.PI with something close to zero? I assume your ship is turning towards the target angle. What language are you using? Is there a reason to be dynamically 'new'ing vectors each frame? I would also suggest working on you vector class a bit more, so that you can directly add them together, rather than adding on a component basis.
  6. JohnHurt

    Function pointers in a GUI?

    I use functors in my GUI system (alongside a message handling system too). Functors are C++ classes which behave like functions: class cFunctor { public: void operator()(/* ... parameter list ... */) { /* function body */ }; }; You can pass these classes around like any other class, declare them like a class, and them call them like a function: cFunctor myfunc; // declare myFunc(); // call
  7. I spent months of my life trying to solve this particular headache. The solution I found was to do as MARS_999 suggests and to just pad your sprite cells with a bit of a border. The simplest solutions are often the best. A secondary cause of this problem comes if you are rendering to a viewport which is of different dimensions to your screen, i.e. and 800x600 viewport area and a 1024x768 screen. I got round this (and was able to develop a resolution independent GUI system), by implementing a "virtual pixel" system, whereby the pixels you render to are transformed into screen pixels before rendering.
  8. JohnHurt

    Flickering Screen After Exiting

    Sounds like a driver issue to me. Not used Vista very much, but I gather that the drivers for it are still in their infancy.
  9. JohnHurt

    beginner help needed!!!!!!

    Learning ASM as a start seems a little odd to me. I'm a software engineer by education and a game programmer by profession and I have literally never touched ASM. C++ is the language of choice in the industry still although steps are being made toward C#. As you are completely new I would advise you to check out something like Blitz Basic - it's easy to learn as is geared towards producing games. QBasic is going back a bit! I haven't used that since 1993!
  10. JohnHurt

    Career in Gaming

    Hi, It's definitely possible. I've just finished a Software Engineering degree and have been offered a job as a game programmer in a pretty large game studio here in England. I was pretty lucky I think (since I don't even have my results yet!), but as long as you have a decent demo and lots of passion, you can get there. Good luck!
  11. JohnHurt

    Need help beginning with C++

    I learned fairly quickly from this book after trying and failing from numerous others. I suppose it depends on the style of writing you prefer (personally I can't abide those Dummies-style books where the author forces his humour on you). I found learning C++ relatively painless, but I was already familiar with a lot of programming constructs from using Basic. I learnt the basics of C++ in around 3 months. But learning a language is insignificant compared to what goes with it. The language itself is simply a tool to be used. The real meat of learning to programming is concerned with algorithms, design patterns, architecture etc. This is why most university courses (in the UK at least) don't teach you much programming - you're left to teach yourself.
  12. Brilliant, that works a treat! My colour properties have colour selection controls now too! Thanks a million.
  13. Ah, that could be it. Will have a crack at that later on this week and report back.
  14. I'm trying to bind a class to a PropertyGrid control so that I can change its attributes. Specifically, I'm making a simple particle system editor. I have the class bound to the control and all the properties are showing up. The problem is that only the properties defined as String are enabled, the other properties are greyed out and read-only. Here's the code for the class: public ref class cParticleDef { private: String^ fEmissionRate; Boolean^ bCanStretch; public: [Category("Configuration")] [Description("Rate of emission")] property String^ EmissionRate { String ^ get() { return fEmissionRate; } void set(String ^ value) { fEmissionRate = value; } }; [Category("Appearance")] [Description("Sets whether the particles can stretch along velocity vector")] property Boolean^ CanStretch { Boolean ^ get() { return bCanStretch; } void set(Boolean ^ value) { bCanStretch = value; } }; }; Also, the boolean property doesn't produce a drop-down control in the PropertyGrid. I'm very new to managed code and .net, so it's probably something really stupid, so I'd appreciate a fresh pair of eyes!
  15. Hi, I'm trying to write a tool for my game in C++ .net. It's a simple windows form app but I'm trying to access classes which are defined in my game engine code. The game engine is in a Win32 static library project. I've set up the engine library as a dependency of the Windows Form app, but I'm getting 4 linker errors when I try and declare an instance of a class from inside the engine library. 1>particle_ed.obj : error LNK2028: unresolved token (0A00000F) "public: __clrcall cMesh::~cMesh(void)" (??1cMesh@@$$FQAM@XZ) referenced in function "private: void __clrcall particle_ed::Form1::Form1_Load(class System::Object ^,class System::EventArgs ^)" (?Form1_Load@Form1@particle_ed@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z) 1>particle_ed.obj : error LNK2028: unresolved token (0A000010) "public: __clrcall cMesh::cMesh(void)" (??0cMesh@@$$FQAM@XZ) referenced in function "private: void __clrcall particle_ed::Form1::Form1_Load(class System::Object ^,class System::EventArgs ^)" (?Form1_Load@Form1@particle_ed@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z) 1>particle_ed.obj : error LNK2019: unresolved external symbol "public: __clrcall cMesh::~cMesh(void)" (??1cMesh@@$$FQAM@XZ) referenced in function "private: void __clrcall particle_ed::Form1::Form1_Load(class System::Object ^,class System::EventArgs ^)" (?Form1_Load@Form1@particle_ed@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z) 1>particle_ed.obj : error LNK2019: unresolved external symbol "public: __clrcall cMesh::cMesh(void)" (??0cMesh@@$$FQAM@XZ) referenced in function "private: void __clrcall particle_ed::Form1::Form1_Load(class System::Object ^,class System::EventArgs ^)" (?Form1_Load@Form1@particle_ed@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
  • 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!