Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 08 Feb 2009
Offline Last Active May 22 2014 07:08 AM

Posts I've Made

In Topic: Global Variables

25 July 2011 - 01:12 PM

I use ClanLib SDK.... Every entity object has CL_Sprite object that contains entity animation.... to create a CL_Sprite object i need to pass as parameters: GraphicContext, resources reference, and finally a string with the sprite name...

this->sprite = CL_Sprite(gc, name, &resources)

So for every entity I need to pass 3 parameters , and this is just a base class... And I'd like to reduce this to just one parameter: a string which contains the sprite name...

Was thinking maybe about a SpriteManager class, so I could pass the string, and it would return a CL_Sprite object...

But I'm not sure what is the best way. Am I going the wrong way ?

In Topic: Global Variables

25 July 2011 - 12:51 PM

ya I think you'll live :D

what do you mean ? It's a really bad idea ? another way to do this ?

In Topic: Noob question about headers

25 December 2010 - 03:06 PM

The idea was that program.h without the #include <vector> will give an error like "'std' : is not a class or namespace name" in my project, the same for #include <ClanLib/core.h>...

How comes in their project it's ok without those includes?

In Topic: Question about a trigger system

12 November 2010 - 12:50 AM

tnx for the formula and for all the explanation :) I think i could use that :)

I was more about how to implement something like in this article: http://www.gamedev.net/reference/articles/article1410.asp , more about the structure, callbacks, I don't know really how to implement something like this :)

Anyway, tnx for all the help and information, I'm sure it will help me :)

In Topic: Question about a trigger system

11 November 2010 - 08:24 PM

Original post by fng
Original post by Sillencer
Let's say there's a mage, and he casts a spell that does not have any animation, it just hits the target, don't see what collision detection has to do with it...

So, if i understand right, what you are supposing is just to use a built-in trigger system of an collision detection system ?? Did I understood it right ? Is this a good idea in practice ?

Yes it is good practice, because there is no other way to do it. How else do you detect that the spell hit something? It all boils down to have bounding shapes, e.g. a sphere for a spell and check the collision of that with the bounding sphere of the target.

The appearance or animation has nothing to do with the trigger itself. However you must detect when the spell hits the target. This is done by collision detection. I would even say most triggers get called when a collision occurs.

It's not what I am trying to say... The spell doesn't have a bounding sphere, it just afflicts the target, and that's all... There's nothing to do with collision detection... And I want to check if a target hits another based on distance from one object to another (if the enemy is range, then hit it every "attack speed" seconds, that's all), not with collision detection, I'm saying that I want an trigger system that has nothing to do with collision detection...