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

Pages: 1 2 [3]
31
Graphics / Re: Help with tile map adventure game.
« on: August 12, 2012, 09:37:42 pm »
Since you know the dimensions of each map screen (60 x 40), an array of 60 elements by 40 elements would suffice.

32
Graphics / Question about sf::VertexArray
« on: August 12, 2012, 09:36:19 pm »
I have created a polygon class and am trying to render it. I created a vertex array containing each point of the polygon and am able to draw the shape to a window, but have no way of changing the color of the polygon's outline (it draws white lines). Is there some way of doing this without resorting to sf::Shape (the polygons can be both concave and convex, preventing me from using the sf::Shape class)?

33
Window / Re: Passing sf::RenderWindow to a function [Solved]
« on: June 30, 2012, 05:49:43 am »
I've been passing it that way, but I wasn't sure if there was a faster way to do it (my FPS has been a bit slow). Thanks for clearing things up!

34
Window / Passing sf::RenderWindow to a function [Solved]
« on: June 30, 2012, 03:41:57 am »
What is the most efficient way to pass a RenderWindow to a function? Is one method preferable compared to another?

35
Window / Re: Only draw tiles that are within view
« on: June 21, 2012, 10:13:44 pm »
I'm also working on a similar project. Assuming that you have a player centered on the screen, the render algorithm should go something like this.

define tileResolutionX as the number of tiles per row
define tileResolutionY as the number of tiles per column
define screenResolutionX as the width of the window you are rendering to
define screenResolutionY as the height of the window you are rendering to

xOffset = player.x - floor(tileResolutionX / 2) -> This will center the map around your player's x-position
yOffset = player.y - floor(tileResolutionY / 2) -> This will center the map around your player's y-position
for x = 0 to tileResolutionX -1
    for y = 0 to tileResolutionY - 1
        render tile(x + xOffset, y + yOffset) at (x * (screenResolutionX / tileResolutionX), y * (screenResolutionY /
        tileResolutionY)) -> This keeps all sprite sizes relative to one another and renders them relative to the player       
    end for
end for

You can replace the resolutions with literals if you don't plan on changing the window's size during the execution of the program.

Hopefully this helps.

36
Graphics / Re: Question Regarding Image Types
« on: June 18, 2012, 01:02:24 am »
Thanks!

37
Graphics / Question Regarding Image Types
« on: June 17, 2012, 09:52:21 pm »
Is there any noticeable difference between image types? If I were to use either a .jpg file or a .png file, would one be faster than the other?

Pages: 1 2 [3]
anything