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

Pages: [1]
1
System / creating a spin-down timer
« on: March 20, 2013, 07:02:33 pm »
Any advice on how to create a spin-down timer?

Ive got an animation running at speed x and i want it to slowly spin down to 0 then stop

im pretty sure it is going to involve three elements like
sf::Clock sysClock;

sf::Time tInitial;
sf::Time tDelta;
sf::Time tTotal;

tInitial = sysClock.restart();
tDelta = sf::Seconds(0.02f);
tTotal = (some math operation combining tInitial and tDelta so i can ramp the animation down)
 

Im using Foalys animation class, so that may have a small/big influence on how to handle this problem.

2
Graphics / more beginner graphics questions
« on: March 19, 2013, 08:30:40 pm »
Im using Foalys Animation Class to tinker around. So far I have an 800x600 playfield with a 400x300 view window. On the playfield I have animated combat dummy. my character has the animations for walking/shooting bow/spear thrust and fidget. I can turn the animated dummy on/off with a key press to reset it for now. And I have a collision event set up that if my character runs into the dummy it animates (to test for future arrow strikes).

Question 1: should I be loading all of the animations into one animation object and then calling up the animations for walk/bow/spear/fidget etc... by which frame to start at or leave it as seperate animation objects for each?

Question 2: my fidget animation is basically a 4 second timer that turns the fidget bool on/off, resets the animation to frame0, runs the animation or stops the animation. what would be the best way to have the fidget animation turn on every x seconds, run for the # of frames in the animation, then turn off and wait til the next timer event?

re-did the video, hopefully it plays better
Video showing what I have working so far..

3
Feature requests / Multiple layer support for sprite sheets
« on: March 17, 2013, 03:19:20 pm »
Instead of using the tools in
sf::RenderTexture
to build up a composited image for animations it would be cool if the library had XCF support so that layers could be turned on/off with switches. The LPC sprite sheets got me thinking about this.

4
Graphics / Re: basic animation help
« on: March 16, 2013, 09:03:25 pm »
works great! now to try and work it around so that i can use it on the fly for movement for multiple entities in the game in multiple directions by using a variable for which way the characters are travelling.

thanks again

5
Graphics / Re: basic animation help
« on: March 16, 2013, 06:33:09 pm »
awesome, thanks, i'll get to work on it right now.
thanks a ton.

cheers!

6
Graphics / basic animation help
« on: March 16, 2013, 05:56:26 pm »
Hi, I've been having trouble with the forums search function so I'm going to ask in here.

I have a sprite sheet, 4 rows of 8 columns showing walking left/right/forward/rear

Can someone give me a quick example of how to 'animate' from the sprite sheet?

this is my very first totally newbie-ish time using sprites so please be kind :)


7
General / Re: How can I create a drag and drop function?
« on: March 15, 2013, 04:49:03 pm »
I was just trying something similar but with hover/moving effects.

I did it with 3 images, normal, hover_effect, moving effect. The effects were basically the normal image with green or red glows in the background.

I had to put some logic in my rendering section though to display the proper image based on a the Bools for hover, moving and buttonDown.

I'm sure there is a more elgeant way to do this inside the SFML library, any suggestions?

// Rendering
                gamewindow.clear();
                gamewindow.draw(background);
               
                if(hover == true && buttonDown == false)
                {
                        gamewindow.draw(highlightChar);
                        hover = false;
                }
                else if(moving == true && buttonDown == true)
                {
                        gamewindow.draw(movingChar);
                        hover = false;
                }
                else
                {
                        gamewindow.draw(normalChar);
                }
                gamewindow.draw(cursor);
                gamewindow.display();
 


8
General / Re: Pong Game Help
« on: March 15, 2013, 12:44:51 pm »
I just multiplied the balls x-axis movement by -1 in my pong game.
Code: [Select]
//Collision
if(ball.getGlobalBounds().intersects(paddle1.getGlobalBounds()))
{
xVelBall *= -1;
hitSound.play();
}
if(ball.getGlobalBounds().intersects(paddle2.getGlobalBounds()))
{
xVelBall *= -1;
hitSound.play();
}

Pages: [1]