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

Pages: 1 2 3 [4] 5 6 ... 9
46
SFML projects / Re: Kroniax - A game of skill
« on: March 08, 2013, 11:52:56 am »
I've just tested version 0.3, it keeps looking better.
The bug in the dialog box I reported earlier (which was probably a Wine bug) does not occur anymore.

47
SFML projects / Re: Kroniax - A game of skill
« on: March 01, 2013, 10:15:10 pm »
The "pixel-perfect" collision is simply a collision between a point and a rectangle, i have 3vertices for my ship, i calculate the position/rotation with the position and velocity vector. And then test if the points/edges intersects with a collision rectangle. For performance, i only check rects that share the x-coordinates witch one point.
Ok I got it, indeed it's a much better way to check the collisions.

Added some messageboxes
I've found a bug in your modal dialogs: you can press the "R" hotkey to replay the level, but once you've pressed it, the next displayed modal dialogs won't work, they're closed as soon as they open and you cannot choose an answer.
Also, the next level should be automatically unlocked if the player clears the current one, because if he accidentally clicks "Replay" the next level is still locked and he has to re-do the whole level.

Window name shows the level progress
That's quite a curious and original place to display it! :D

Nice to see an update already, good luck with your project!

48
Graphics / Re: How do I implement smooth scrolling? (example inside)
« on: March 01, 2013, 08:52:43 pm »
I've always assumed enabling vertical sync would simply override framerate limit.
That's a false assuption. Not sure how you got that idea. ;)

The documentation states that enabling vertical synchronization will limit the framerate anyway, that's why I assumed calling setFramerateLimit wouldn't have any effect.
Quote from: the friendly manual
Activating vertical synchronization will limit the number of frames displayed to the refresh rate of the monitor.

If this can lead to a buggy behaviour, maybe calling setVerticalSyncEnabled(true) should enforce the framerate limit to 0?

49
Graphics / Re: How do I implement smooth scrolling? (example inside)
« on: February 28, 2013, 09:49:23 pm »
Don't activate framerate limit and vertical sync at the same time, it doesn't make sense.
Can it cause problems?
I've always assumed enabling vertical sync would simply override framerate limit.

50
SFML projects / Re: Kroniax - A game of skill
« on: February 28, 2013, 09:44:46 pm »
Nicely done and very addictive!
Quite hard too, couldn't get past level 1 despite many attempts. Maybe it needs some balance?

Some suggestions:
- Add keyboard bindings (up, down, return) to your GUI. I find it very annoying to grab my mouse just to click the replay button.
- Maybe a progress bar to display player's progression in the current level.

Also, how did you handle "pixel-perfect" collisions with a rotated shape?
Since the tiles are just squares and the player just a triangle, did you simply compute line intersections?

51
General / Re: Need help with sf::Texture, sf::Sprite and design choices
« on: February 22, 2013, 07:07:25 pm »
since the sf::Sprite takes a reference to a sf::Texture then there should be no problem with my cache since the texture will be alive for as long as there are sprites referencing it? Or am I thinking it wrongly?

The sf::Sprite class doesn't own a copy of the texture, only a pointer. So when you call sf::Sprite::setTexture, you have to make sure the texture object is stored somewhere else during the sprite lifetime.
That's why almost all applications use a resource manager :
- textures being heavy resources, it ensures each resource is loaded once and only once.
- it also ensures the textures will remain available during all the program execution

What would be a better overall design choice:
a) to have the board class load the texture and for each tile to have it's own sf::Sprite?
b) to have the board and tile classes only contain "logic" parts, and have a separate manager class to take care of creating sprites and drawing and then somehow unify all that in the main game class?
c) neither?
I would say the Board class acts as the tile manager, and I would either make Tile inherit from sf::Sprite, or Tile having a sf::Sprite attribute. (You're not supposed to inherit SMFL classes because it's not a framework, but I confess it can be convenient sometimes).
A resource manager class will store the textures, and you can set the tile's texture either from the Board class, of from the Tile class itself.

52
Graphics / Re: How to draw a repeated pattern?
« on: February 19, 2013, 07:04:49 pm »
Ok thank you, I'll do that (or maybe use a RenderTexture).

53
Graphics / Re: How to draw a repeated pattern?
« on: February 19, 2013, 02:38:58 pm »
To repeat a texture, you must use a texture rectangle which is bigger than it. So you can only repeat the whole texture, not a sub-rectangle (remember, you call setRepeated on the texture itself).
Yes that's what I thought, but I was still hoping there was some magic trick I didn't hear about.
So that's mean that if I want to stick with my pattern sprite sheet, I need to code the tiling background myself by drawing the sprite several times?

54
Graphics / [SOLVED] How to draw a repeated pattern?
« on: February 19, 2013, 01:50:48 pm »
Hi,

I want to display a background using a tiled pattern.
I know this can be achieve by using a sprite with a repeated texture, but I want to avoid using one image per pattern, because I'd like to group them in a single sprite sheet (I intend to deal with many small patterns so a single image would be much more efficient and convenient).

For example, this is a 64x64 spritesheet with 4 32x32 patterns.

Let's say I want to draw a 640x480 background with the top-left pattern.
I tried using a RectangleShape and a repeated texture:

sf::Texture patterns;
patterns.loadFromFile("patterns.png");
patterns.setRepeated(true);

sf::RectangleShape background;
background.setTexture(&patterns);
background.setTextureRect(sf::IntRect(0, 0, 32, 32));
background.setSize(sf::Vector2f(640, 480));

But I just ended with a streched/scaled background:


Any advices?

55
Graphics / Re: Multiple colours in a single string?
« on: February 18, 2013, 05:18:08 pm »
It's not possible using sf::Text, however there is a RichText class available on the wiki, which enables users to set different colors and styles within the same text object.

https://github.com/SFML/SFML/wiki/Source%3A-RichText

56
General / Re: What IDE should I use?
« on: February 18, 2013, 04:49:04 pm »
I haven't really heard of Geany, but just by looking at the website, it seems to be more into the direction of Code::Blocks, but even more lightweight.
Geany hardly qualifies as an IDE, because it lacks a lot of basic features such as generating your makefile, code completion, managing lib dependencies, link edition and creating build targets.
It's "just" a text editor with the ability to compile your current .c/.cpp unit into a .o object.
More advanced features are just buttons for which you need to specify the command line callback.

So if you want to use Geany for a SFML project, you need to write your makefile first. Which leads to pick a tool for generating your makefile as soon you have to deal with more than a couple of source files or build targets.

If you're not used to write your own makefile and the tools chain which come with them,  Code::Blocks is definitely the way to go, it's very easy to use and it even has default SFML project templates (linker settings + minimal code).

57
General discussions / Re: More Community-driven Development
« on: February 17, 2013, 03:50:30 pm »
Telling all of these points to the pull requester takes a lot more time than simply fixing them.
I find this part questionable, because it seems to me we're talking about:
- dropping a comment on github
VS
- merge the pull request,  open your development environment, make the changes yourself and commit them.

If the contributor needs to apply a couple of another commits to his pull request before Laurent can approve it, of course it will take longer for the pull request to find its way to the upstream repository, but it will probably save Laurent's time overall.

58
General discussions / Re: A new logo for SFML
« on: February 07, 2013, 06:01:33 pm »
My minimalistic attempt:


At a small resolution, the "simple & fast multimedia library" label could be removed.

59
SFML projects / Re: CosmoScroll - space shooter game
« on: July 24, 2012, 03:29:52 pm »
Still using SFML 1.6 = ATI bug doesn't let me run the game. :(
Oh, I tought the ATI bug was only about a crash at exit (which compiling with static linking can fix). But I've searched on the forum and Laurent wrote there is a second ATI bug as well : freeze at global startup when using Catalyst drivers.

Someone might found a workaround in this topic, which just requires adding a ATI dll in the executable's directory.
Here's a packaged version of CosmoScroll with all the ATI dlls (atioglxx.dll, atigktxx.dll, atio6axx.dll), atio6axx.dll should be the one you need for 64bits drivers, so consider deleting the other ones if it sill doesn't work. See this page for more details about those dlls.

This is just a workaround, migrating to SFML 2.0 is on the top of my TODO list.

Everything works good. Maybe you could make the player´s ship slide a little bit, some kind of inertia?
I already implemented inertia and quickly reverted to the previous behavior because this made the game insanely difficult. You really need instantaneous movement response and upgrading the spaceship engine, especially past the level 3 (level 1 and 2 are really easy).

And also you could make the player´s ship collider smaller so it´s harder to get hit. But it´s just my feeling maybe I am a bad space shooter player!  :D
Collisions are pixel-perfect, making the hit box smaller than the spaceship would not be very fair :)
If you're really having trouble, you can redo previous levels and gain more credits for buying better items.

60
SFML projects / Re: CosmoScroll - space shooter game
« on: July 24, 2012, 09:39:31 am »
A new version of CosmoScroll is now available!

What's new in CosmoScroll 0.4?
Quote from: changelog
* Gameplay
- You can collect credits by killing bad guys in Story Mode
- Earned credits can be spent in Armory Menu to upgrade your spaceship
- 6 components to improve: Energy Shield, Armor, Engine, Heatsink, Laser Cannon and Plasma Cannon
- When playing in Arcade Mode, your improved spaceship from Story Mode is automatically imported
- 2 new enemy types
- 2 "indoor" levels, with interactive decors (doors, turrets, cannons)
- Audio signal when heat level raises
- Escap no longer quit the game without confirmation (use Alt-F4 for this)

* Display
- New design for the HUD
- the HUD displays a timer for each temporary power-up
- Decors and spaceships flash in red when damaged
- Parallax scrolling, with new background images
- Animation when player is destroyed
- Smoke effect improved
- Window centered on desktop at start

* Other
- Different background music for each level
- New translation: german
- Enable/disable vertical synchronization in settings menu
- New sound effects
- Optimized pixel-perfect collisions
- Configuration saved in your OS settings directory
- The game can be launched form any directory (you don't need to be in game directory anymore).
- Bugfix wrong md5 checksums on 64 bits platforms
- Bugfix players allowed to send score with an empty pseudo
- Manual available in english (README.html)
- Dependencies included in Linux release

Screenshots






Download CosmoScroll 0.4 :

Source code is available on Googlecode.
As always, feedback is welcomed and feel free to suggest new features!

Pages: 1 2 3 [4] 5 6 ... 9
anything