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 - Finn

Pages: [1] 2 3 ... 6
1
Okay I think now I got something that's very close to what I want.

My vectors consist of x and y coordinates
O = Object-Vector
M = Mouse-Vector
P = Player-Vector
r = radius

and this is what my algo comes down to:

O = P + r * (P - M) / (|P| - |M|)
 

It works flawless...except that it doesn't gimme the coords of the circle-side facing the mouse...instead it gives me the coordinates on the other side of the circle. Any ideas on how to fix it?

Greets,
Finn

PS: You helped me alot so far, you're great! :o)

EDIT: GOT IT!! Changed to :
Code: [Select]
O = P - r * (P - M) / (|P| - |M|)

2
Yeah that's the problem...I'm thinking about this problem for hours and didn't come to any solution yet...guess I just got a brainlock or something :D

I would really appreciate if you'd show the the mathematical steps I have to do with examples!

Greets,
Finn

3
Oh you guys are fast :D

Some code would be helpfull though :-/

P = Playercoordinate
M = Mousecoordinate

First off getting PM by M-P.
sf::Vector2<float> pmVector;//player to mouse vector
pmVector.x = MouseX - PlayerX;
pmVector.y = MouseY - PlayerY;
 

Right?
What now?

Greets,
Finn

4
Hey there!
Got a pretty much mathematical problem here I couldn't figure out after hours of trying...maybe some1 can help me.

Let me explain...


So I want to set the object's position to a coord on the circle.
The circle's coord should be calculated using the angle between the player and the mouse-position.

Hope you know what I'm talking about.

Greets,
Finn

5
General / Main Menu in SFML need tips
« on: December 05, 2010, 10:06:40 am »
There a several ways to do it, but most of them are really easy!
I did mine with Images as buttons. Then just check if one of the buttons is clicked and if so, go on to whawtever the button says :)

6
General / Handling FileInput?
« on: December 01, 2010, 08:17:06 pm »
Anyone's got an idea how I could manage to open a filescreen where you can choose a file? Like almost every software has...something like an "Open"-thing. Hope you know what I mean :)

7
Network / download image from html
« on: October 31, 2010, 09:20:44 am »
Sure it is!

8
SFML projects / Sketch RPG
« on: October 09, 2010, 09:41:42 pm »
Yeah...why not! Just contact me...do u have icq/msn?

9
SFML projects / Sketch RPG
« on: October 08, 2010, 08:03:11 pm »
Yep :) I'm sure I'll work on it for a long time. Dunno if it will be finished, but even though it's fun and good practice ;)
I hope to get feedback by more people so that I'm more motivated to go on :D
Thanx,
Finn

10
SFML projects / Sketch RPG
« on: October 07, 2010, 06:32:50 pm »
Oh...sorry :P Use Hyper Cam than ;)

11
SFML projects / Sketch RPG
« on: October 07, 2010, 04:23:55 pm »
gtk-recordMyDesktop. For Videoediting: Pitivi. But Youtube doesn't seem to like the format of the movie after editing so you have to convert it! For this I used DeVeDe ;)

12
SFML projects / Sketch RPG
« on: October 07, 2010, 07:17:10 am »
A new video is out! Link: http://www.youtube.com/watch?v=MB0ov1zxsgM

13
General / Better way of enemy-list
« on: October 06, 2010, 12:56:55 pm »
Damn. If I knew that earlier I I haven't had that problems :D

14
General / Better way of enemy-list
« on: October 06, 2010, 07:20:53 am »
So changes will take place without having to refill the vector?

15
General / Better way of enemy-list
« on: October 05, 2010, 08:44:11 pm »
Hey!
I have some problems with my enemylist. All enemys are saved in a std::vector. So...I can't change them on the fly. I have to do:
Code: [Select]

std::vector<enemy>::iterator It;
enemy Enemy;
for(It = List.begin(), int i = 0; i < List.size(); i++, It++)
{
    Enemy = List.at(i);
    List.erase(It);

    //change things like position and stuff...
   
   List.push_back(It);
}


But this produces some lag for the enemys. So it seems!
What's a better way of doin' this?
thx,
Finn

Pages: [1] 2 3 ... 6