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

Pages: 1 2 [3] 4
31
System / Only want a function to get called once on a keyDown.
« on: January 24, 2012, 08:51:07 pm »
sf::Event does seem the best way to do this. However, it seems that I cannot pass my window instance to my class. Any idea's how to use sf::Event within my class?

32
System / Only want a function to get called once on a keyDown.
« on: January 24, 2012, 07:55:26 pm »
I want to do something every time the button is pressed.

33
System / Only want a function to get called once on a keyDown.
« on: January 24, 2012, 02:39:12 pm »
Can anyone lend a hand on this? I'm struggling to get this working.

34
System / Only want a function to get called once on a keyDown.
« on: January 24, 2012, 09:13:40 am »
I'm using this

Quote

this->LeftButton = sf::Keyboard::IsKeyPressed(sf::Keyboard::A);
if( this->LeftButton ){
      this->MoveLeft();
   }

35
System / Only want a function to get called once on a keyDown.
« on: January 23, 2012, 11:23:15 pm »
Hello, I'm using AniSprite to animate my sprites, this works well and I can play animation with ease.

When I press D on my keyboard I'm adding some velocity to move my sprite, but at the same time I'm calling AniSprite.Play(0,5); to play the animation. The obvious issue here is that Play(0,5) is called every frame, so that the animation never actually starts.

How do people get around this?

36
System / Do something every 10 frames
« on: January 23, 2012, 12:07:05 am »
Yeah 2.0 and yeah I figured that soon after I posted this!

37
System / Do something every 10 frames
« on: January 22, 2012, 11:03:30 pm »
Hay, I'm using window.GetElapsedTime() to keep my framerate consistent across multiple computers.

How would I use this to see if 10 frames have passed? So every 10 frames do something?

38
Graphics / Is it possible to draw FloatRects to the screen?
« on: January 22, 2012, 08:39:14 pm »
I guess that's the only way to do it. Ok, thanks.

39
Graphics / Is it possible to draw FloatRects to the screen?
« on: January 22, 2012, 08:21:46 pm »
but RectangleShape doesn't have the methods like Intersect and Contains though.

40
Graphics / Is it possible to draw FloatRects to the screen?
« on: January 22, 2012, 07:34:31 pm »
As the title suggests, I'm using FloatRects for some collision detection. Is it possible to draw these to the screen so I can see their positions? I know I could simple copy the attributes of said FlaotRect then create a Shape, but I'm wondering if it's possible without the need of using Shape.

Thanks!

41
Graphics / Jump doesn't realistically
« on: January 21, 2012, 11:47:11 am »
How would I about doing this? If Y is above a certain point then change the yVelocity, or if a certin amount of time has pass changed the Yvelocity?

42
Graphics / Jump doesn't realistically
« on: January 20, 2012, 08:40:27 pm »
Hay I have a simple script which makes my sprite jump.

I have this line being fired every frame

Quote
   this->sprite.Move( (this->deltaTime * this->xVelocity), (this->jumpSpeed * this->deltaTime) * this->yVelocity);


And when my jump button is pressed this code gets run

Quote
this->yVelocity = -this->weight;
      if (this->sprite.GetPosition().y < apex) {
         this->isJumping = false;
      }


This works well. I hit jump, my character jumps, reaches a peak then drops down. However, my movement is more like an upside down V rather than an arch. How would I accomplish a more "real" jump effect?

43
Graphics / AniSprite Error
« on: January 18, 2012, 07:50:19 pm »
Are you playing the animation? Do you have any code to show us?

44
Graphics / AniSprite Error
« on: January 17, 2012, 09:18:39 pm »
Hmmm, ok I got it all working apart from the clock.

I get these issues

Code: [Select]
Undefined symbols:
  "sf::Clock::GetElapsedTime() const", referenced from:
      AniSprite::Update()     in AniSprite.o
  "sf::Clock::Clock()", referenced from:
      AniSprite::AniSprite(sf::Texture const&, int, int)in AniSprite.o
      AniSprite::AniSprite(sf::Texture const&, int, int)in AniSprite.o
      AniSprite::AniSprite()in AniSprite.o
      AniSprite::AniSprite()in AniSprite.o
  "sf::Clock::Reset()", referenced from:
      AniSprite::Play(int, int)in AniSprite.o
ld: symbol(s) not found
collect2: ld returned 1 exit status


But the clock is setup in the head file? Any ideas?

45
Graphics / AniSprite Error
« on: January 17, 2012, 08:28:18 pm »
Care to explain how you got it working?

Pages: 1 2 [3] 4
anything