Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - vivo

Pages: [1] 2 3 4
1
General / Re: I'm confused about collision detection.
« on: April 05, 2013, 03:53:57 pm »
I want to detect collision between player and object in map. I keep all objects in vector.
Here this is the code

bool Collision::IsCollided(Player *player, std::vector<Platform*> platformList)
{
        for(int i = 0; i < platformList.size(); i++)
        {
                if(player->GetPosition().x + player->GetWidth() > platformList[i]->GetPosition().x &&
                        player->GetPosition().x < platformList[i]->GetPosition().x + platformList[i]->GetWidth() &&
                        player->GetPosition().y + player->GetHeight() > platformList[i]->GetPosition().y &&
                        player->GetPosition().y < platformList[i]->GetPosition().y + platformList[i]->GetWidth())
                        return true;
        }
        return false;
}
 

I don't really understand the problem, but maybe intersects method can help you, would be something like:
bool Collision::IsCollided(Player *player, std::vector<Platform*> platformList)
{
        for(int i = 0; i < platformList.size(); i++)
        {
                if(player->GetSprite().GetGlobalBounds().intersects(platformList[i]->GetSprite().GetGlobalBounds())
                        return true;
        }
        return false;
}
 

2
General / Re: rbSFML
« on: March 01, 2013, 02:22:12 pm »
Sounds really interesting and most of all, useful!

Also the OpenGL extensions primary goal is not to be used for 3D really. Though it would be nice and cool. It's to allow you to extend SFML yourself in Ruby code like how you can do in C++ with sf::Drawable and so on.
I haven't tried any of that stuff, all I can say is, keep the good work  :)

3
General / Re: rbSFML
« on: March 01, 2013, 02:03:53 pm »
I appreciate your altruistic work here, I haven't tried any 3D aspect but I must say rbSFML actually works great with 2D graphics.
What kind of book are u writing?

4
General / Re: rbSFML
« on: March 01, 2013, 01:18:10 pm »
Hello! It has been a long time since the last time I post here. I'm surprised that there has been no activity here... I've found ruby a great language for developing games, really friendly  :-\
BTW, I wanted to announce here that that the Ruby Adventure Game Engine it's almost finished, it's my first project in Ruby, SFML and even games :-P but I think the final result it's not bad at all, at least for being a first iteration. I'll post a link to a github project when the doc is ready and fix a few issues of the engine (maybe a mounth?) in case anyone wanted to use it
regards

5
General / Re: CanĀ“t load Font files under Linux
« on: February 26, 2013, 01:35:36 pm »
Hi, using linux and rbSFML i do:
@@font = Font.new(Fonts_path.to_s + 'ilits.ttf')
 
I had problems with the loadFromFile method too, try with the constructor as I did

6
General / Re: Trying to implement DeWITTER's game loop.
« on: February 14, 2013, 03:47:01 pm »
Okay, but limiting framerate is an okay way to go about it?
if your framerate is always higher than the limit: yes

7
General / Re: Trying to implement DeWITTER's game loop.
« on: February 12, 2013, 01:57:53 pm »
You are adding the "lex" value to the interpolated one, whereas you should multiply the interpolated value with a constant value wich would represent a velocity factor.

view_position = position + (speed * interpolation)

for the bottom one, it's ok (and very smoothly) while your frame rate doen't suffer variations (your case).

view_position = position + "lex"(constant var: 0.05)

Also eXpl0it3r is right, no need to load the font at each frame

8
General / Re: rbSFML
« on: June 14, 2012, 10:45:07 pm »
Thanks, done

9
General / Re: rbSFML
« on: June 11, 2012, 12:04:26 pm »
so is it internally called by RenderTexture when you for instance call the scale method?

How would you do the trick?
I've tried with scale (-1,1) without success

10
General / Re: rbSFML
« on: June 10, 2012, 11:56:29 pm »
I again Groogy, more reports:
when I try the applyTransform method from a RenderTexture instance I get:
undefined method `applyTransform' for SFML::RenderTexture(0x0, 0x94c92c0):SFML::RenderTexture (NoMethodError)

All I want is to get a mirrored texture from another one, do you know an easier way to do it?

11
General / Re: rbSFML
« on: May 29, 2012, 07:41:45 pm »
yes... seems more intuitive that way

12
General / Re: rbSFML
« on: May 29, 2012, 07:14:07 pm »
oooooppssss... now I know whats happening here

I'm trying
texture = Texture.loadFromImage(image, area)
 
but the message is that there is no method for Texture:Class
whereas if I try the method in an object
texture = Texture.new
texture.loadFromImage(image,area)
 
then it works

(weird... sprite = Sprite.loadFromImage works :P)
either works...ok, sorry for my missunderstanding

13
General / Re: rbSFML
« on: May 29, 2012, 06:57:25 pm »
sorry, as you can see I deleted my message as soon as I noticed it.
BTW, I still can't use the method... does it works on your installation?

14
General / Re: rbSFML
« on: May 28, 2012, 06:58:41 pm »
Hi there, seems that there is no method Texture:loadFromImage
/home/vivo/Escritorio/proyectoAG/proyecto/SceneChar.rb:57:in `block (2 levels) in load_animation': undefined method `loadFromImage' for SFML::Texture:Class (NoMethodError)

15
General / Re: rbSFML
« on: May 23, 2012, 09:31:56 am »
thanks Groogy, now it works!

Pages: [1] 2 3 4