Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

HappyCoder

Member Since 28 Apr 2007
Offline Last Active Yesterday, 05:59 PM
-----

Posts I've Made

In Topic: Uncertainty with VBO and OpenGL

19 May 2013 - 05:38 PM

Here is how I use them.

When I load the game, I create a VBO for every type of object in the scene. For example, if there is a certian type of enemy in the game, then I create a single VBO for that enemy, load it in, then reuse the same VBO every time I draw an enemy of that type.

In Topic: Kronologic 64

19 May 2013 - 05:03 PM

I can't seem to do anything.  the page loads, planet is spinning, music plays.  and nothing.  I'm not sure if it's trying to load stuff, so i let it sit for about 15mins(which should be more than enough to grab 6.5mb on my connection).
 
on firefox 20.0.1(although it looks like i've got an update, so let me try again when that's downloaded).
 
edit: same problem on 21.0

It must not be loading the web font correctly used for the buttons on the main menu. I will investigate that. I know the game works on chrome.

In Topic: creating a 3d map editor

09 May 2013 - 11:26 AM

One option I would like to throw out there is using Blender.

It is not ready to be a map editor on its own but writing some scripts can extend functionality to allow you to use it as a level editor and export maps. It would take some work to write the scripts but it would less work than writing an editor from the ground up.

In Topic: What's the best way to do this?

08 May 2013 - 02:36 PM

Don't make enemies inherit from a drawable object, rather you should have the enemy use a drawable object.

Make the enemy a subclass of an entity object, that other entity objects can then inherit from.

Use smart pointers in your vectors, the standard library has shared pointer you can use (shared_ptr). This way objects don't have to be copied everywhere.
class Entity
{
    std::shared_ptr<Drawable> drawable;
public:
    Entity(const std::shared_ptr<Drawable>& drawable);
};

class Enemy : Entity
{
public:
};

Now that you have separated your drawable class from your entity class you can change how an enemy is drawn simply by passing it a different drawable. Whenever the enemy moves or changes in any other way, it updates its corresponding drawable object. This may seem like extra work but in the end it is a much better design and will let your code be much more flexible and your project can continue to grow without coming apart at the seams.

In Topic: Html5 Canvas: Why in the following JSFiddle, the stroke rectangle full opacit...

04 May 2013 - 12:00 AM

It appears that it is your line width and the canvas seems to be off by half a pixel. When the width is increased to 2 the lines draw solid.

 

When the first two parameters of strokeRect are increased by 0.5 the lines draw correctly.


PARTNERS