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

Pages: [1] 2 3
1
There is nothing wrong now.

2
So I'm making those libraries that can animate changes (like position change, scale, origin and rotation), execute functions after timeout and in intervals and making event listener and onclick functions (which isn't coming up very fast since there are many different events and when you rotate and do other stuff to sprite it is hard to determine is it clicked on or not).

I putted a test exe file in attachments (dosen't include the 3 dll files needed to run it, so you will have to add that).
It has 1 second timeout till beginning and I seted an interval to repeat the animation every 9 seconds, because that is how long it lasts.

So try out my test file and if anyone has any idea what else I could make please tell.

[attachment deleted by admin]

3
General / Events & Animations
« on: May 01, 2013, 12:08:28 am »
So I made a little library which beside other functions has setInterval and setTimeout functions.
They are part of my class which I call zSFMLe and it has a class Loops of which I made a vector.
Those 2 functions takes a function pointer, which takes a void pointer, and a void pointer to be passed to that function and time in milliseconds.
How I made it is that you make a zSFMLe object and use its functions setInterval and setTimeout to add things to the vector. It also has a timing function which I call every time before drawing, it checks should any of the functions be called.

Now the problem is that I have to make a new class that will contain all the data that I have to pass to that function, I have to use void pointer to pass that object to the function and then make variables in which I will store the values which I stored in the object.
Is there an easier, simpler way to pass data to a function?


That library also has onclick and addEventListener functions, although they aren't finished, so they do only the most basic things.
I also have a animation library that animates chenge of Position, Rotation, Scale and Origin, but only linearly, I'm planing to add nonlinear (how ever that is called) animation soon.

I putted a test exe file in attachments (dosen't include the 3 dll files needed to run it, so you will have to add that).
It has 1 second timeout till begining and I seted an interval to repear the animation every 9 seconds, because that is how long it lasts.



[attachment deleted by admin]

4
General / Re: Calculating position
« on: March 28, 2013, 07:22:33 pm »
Why do you have to be like that man?

Anyway, I figured out the problem, I forgot to convert to radians. It works now.

5
General / Re: Calculating position
« on: March 27, 2013, 11:24:41 pm »
That is the same thing other guy pointed me to.
That still dozen't tell me what is wrong with my code. (posted in previus post)

6
General / Re: Calculating position
« on: March 27, 2013, 03:10:30 pm »
Ok so this is what I tryed
double y = tankVL * std::cos(rotate+startR),
x = tankVL * std::sin(rotate+startR);
And it dosen't show the correst cords.
I puted a small rectangle at the resulting coordinates and insted of being at the corner of the sprite it was rotating around it's center (every freme in which I change 'rotate' (I change it by 2) it rotates 120 degress around the center). That gives me an idea to make some special effect around the player when he uses something, but dosen't solve my problem.

my startR var is the starting angle of coordinates position, roration var is what I setRotation of sprite and tankVL is the distance from center. (see the pic)

I made this picture which shows what I'm trying to do.
If I mesed up something in the formula please tell.


[attachment deleted by admin]

7
General / Calculating position
« on: March 25, 2013, 11:56:16 pm »
Ok, so now I have reversed problem (reverse of my other question).
I have the angle and the vectors lenght and I need x and y (if the vector starts at the coordinates 0,0).
I have tryed something, but it didn't gived the correct results and when I though about it I realized why and I'm just to tired to think about it any more.
So if anyone has any ideas please post.

Not important: I need this because I have a rectangle (sprite) in the middle of the screen, with origin in it's middle and it is rotated by the player. Now I have to get the x,y of the sprite's corners (all 4 of them) to calculate if he can no more rotate in that way or go forwards/backwords.

8
Graphics / Re: geting pixel
« on: March 25, 2013, 03:00:04 pm »
Well looks like I'll have to go with my idea, get max texture size and use that for the map, checnge it only when close to edge.

9
Graphics / Re: Squere Fullscreen
« on: March 24, 2013, 03:20:42 pm »
Thanks, I'll check out view reference.

10
Graphics / Squere Fullscreen
« on: March 24, 2013, 12:20:43 pm »
How do I make a game fullscreen, but use only the center part of the screen, so that the space I'm using has same hight and width?

11
Graphics / Re: geting pixel
« on: March 24, 2013, 12:07:24 pm »
I don't think sprites will work for me.
You see I have those circleshapes around the player and the cursor position and I set a part of the texture to them, so that only that part is visible, because it is underground.
And I have been trying things out.
Now I only have to get 4 pixels of the picture, the corners of the tank picture (the player) and some bot enemies and the game is ready to go.
But it woryes me that the tank rotates much slower when moving, because I reload the texture when moving.

12
Graphics / Re: geting pixel
« on: March 23, 2013, 01:26:53 pm »
So, how do I use multiple textures as one?

13
Graphics / Re: geting pixel
« on: March 22, 2013, 07:23:08 pm »
I just looked at the map size and a realy good gpu could have it all in one peace, but I don't have so good gpu and probably many other people don't have it either.

But what is bothering me is that I don't know how to use multiple textures as one in sfml?

14
General / Re: Get picture from swf file
« on: March 21, 2013, 12:21:59 pm »
I don't think he would mind if I take his pictures, it dosen't look like that is a real big game.
And I did googled for softwere to get pictures, but as I said I didn't found anything that worked.
Thanks for the link, I found the tank pictures I needed.

15
Graphics / Re: geting pixel
« on: March 21, 2013, 11:21:48 am »
Wouldn't it?

Pages: [1] 2 3