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

Pages: [1]
1
Graphics / checking view
« on: March 12, 2010, 11:51:49 pm »
How can i check the right of the view, i'm using the getcenter but that only gets the center well i want it before, before the user even sees the background. How could i do this?

Thanks,

Haxortiz

2
Graphics / Scrolling Background
« on: March 10, 2010, 05:41:50 pm »
Quote from: "model76"
Well, how about comparing the view's position to the position and size of the background sprite? Remember to account for the view's size, as well, if you need that.


How can I get the position of the view? since getPosition isn't in View Class.

3
Graphics / Best X & Y Position
« on: March 10, 2010, 05:39:12 pm »
Quote from: "Nexus"
Increase/decrease the velocity? Use an if statement? :idea:

If you don't know how to react to keyboard input, you should read the tutorials.


I have, this is what i got so far...
Code: [Select]
if (App.GetInput().IsKeyDown(sf::Key::D))
{
if(player.getEnergy()>100)
{
if(player.getPositionX()!= (game.getWidth()- 100))
 {
  player.Move(subVelocity * elapsedTime);
  player.setEnergy(player.getEnergy()-1);
 }
}
}

But everytime I try and use + or -, it starts having errors. Is there a better way?

[Edit]Doesn't Matter, done it now. Wow some really noobish errors in that coding. Haha, Thanks for the help.

Haxortiz[/Edit]
[/b]

4
Graphics / Best X & Y Position
« on: March 10, 2010, 05:23:25 pm »
Well I'm doing a submarine that moves across so I used

Code: [Select]
player.Move(subVelocity * elapsedTime);

To move it across but how can I add or subtact to make it go faster or slower when the user press a key?

Thanks,

Haxortiz

5
Graphics / Best X & Y Position
« on: March 10, 2010, 12:23:25 am »
Quote from: "Laurent"
Code: [Select]
sprite.Move(velocity * elapsedTime);


Thanks this example really helped,

Haxortiz

6
Graphics / Best X & Y Position
« on: March 09, 2010, 09:56:34 pm »
How can I use sf::Vector2f to do the velocity of the sprite, can I have an example please.

Thanks,

Haxortiz

7
Graphics / Best X & Y Position
« on: March 09, 2010, 09:30:38 pm »
What's the best way to find and move the X and Y position of a sprite?

And i can i use a vector for Velocity of this sprite.

Thanks,

Haxortiz

8
Graphics / Scrolling Background
« on: March 09, 2010, 09:27:07 pm »
Quote from: "Laurent"
Quote
how can I move string text with the view?

Draw it with another view that doesn't move. window.GetDefaultView() should be ok for that.


Thanks.

Got it working how can i found out when the view goes past the background sprite.

Haxortiz

9
Graphics / Scrolling Background
« on: March 08, 2010, 09:47:19 pm »
Thanks for the help I have got the view moving along but how can I move string text with the view?

Haxortiz

10
Graphics / Scrolling Background
« on: March 08, 2010, 03:11:46 pm »
Nope :S, didn't think there was one.

On this website?

Can i have a link please

Thanks,

Haxortiz

[EDITED] Doesn't matter I have found the View tutorial. Thanks anyways

11
Graphics / Views
« on: March 08, 2010, 11:54:36 am »
Ok, so i set a new view up at beginning, set the centre of the view and do i move the view inside the game loop? also do i have to draw the view at the end.

Sorry for some of these noobish questions lol. Still learning this multimedia library.

Thanks,

Haxortiz

12
Graphics / Scrolling Background
« on: March 07, 2010, 01:40:56 pm »
No not yet, i tried using a view but not sure how to attach it to the background image.

Also do u think u can give me some example coding to produce this action please, first time using SFML its for my assignment lol.

13
Graphics / Scrolling Background
« on: March 06, 2010, 01:28:26 pm »
The user is a submarine that goes up and down but only increases it's velocity left to right either faster or slower. While the background scrolls from right to left as the game goes on.

Just thinking how to get the background scrolling using one background image but only showing so much at a time.

Thanks,

Haxortiz

14
Graphics / Scrolling Background
« on: March 06, 2010, 12:12:16 am »
Hello,

I have been working on this project for few days and I really have no idea how to make a scrolling background.

If anyone can help me it would be so greatful. Also example of coding on how to produce this would be great.

Thanks,

Haxortiz

Pages: [1]
anything