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

Pages: [1] 2 3
SFML projects / Re: Pentads, yet another Tetris clone
« on: April 02, 2013, 12:47:55 pm »
Thank you for your feedback!
Frankly speaking, the lack of immediate exit annoys me too.;) I'll add it ASAP. By the way, in the 1st iteration of the game there was a zone in the upper left corner (like Esc key on a PC keyboard) of the touch-screen to tap for exit. Later it was removed.

SFML projects / Re: Pentads, yet another Tetris clone
« on: April 02, 2013, 07:32:52 am »
Sorry for resurrecting the old topic. Just want to let everyone who downloaded Pentads (27 downloads of alpha version) and maybe liked it, know that while waiting for the stable SFML-2 release to finish the game, just to get acquainted with development for Android I ported the game to libgdx and published it on GooglePlay. It looks a bit different. Of course it's free.

SFML projects / Moonman's Xmas
« on: December 16, 2011, 02:44:43 pm »
The building on the picture suspitiously resembles the Lenin's Mausoleum in Moscow, Russia. :) Maybe that funny guy is Lenin himself. 8)

General / Advice on bullets? [SOLVED]
« on: October 31, 2011, 04:49:27 pm »
To avoid time consuming creation-insertion(copying to a container)-removal of big number of objects you may use a pool of pre-created objects (bullets in your case). Instead of removal a bullet when its life expires you just make it invisible and place its index (in case of using vector) in a stack of available bullets. When you need a new bullet you get the first available index from the stack, initialize the bullet with appropriate arguments (position, velosity, etc.) and make the bullet visible. I gave you just a bare idea. I think you can find a lot of information and tutorials on using pools in the Internet.

Graphics / I have absolutely no idea why this isn't working
« on: September 06, 2011, 06:57:23 am »
At a quick glance:

You are drawing the text inside the event-processing while loop. While there are events in the queue the text is visible.

The line:
if (DrawText = true)
should be:
if (DrawText == true)
or simply:
if (DrawText)

The variable Next is useless. You initialize it once before getting in while loop. After that it knows nothing about the actual Return key state.

Two sequential event-processing loops look rather odd.

General / Passing "App" to my class's constructor? (solved!)
« on: August 21, 2011, 06:22:47 pm »
jkalmeij already pointed the error.
You defined the local 'sf::Sprite self' inside the constructor and initialized it instead of the member variable 'self'.

General / deleting sf::Texture* - I must be doing it really wrong
« on: August 19, 2011, 04:49:21 am »
So far everything looks fine. Though I prefer insertion of key-value pairs into a map like this:

Code: [Select]
mMap.insert(make_pair(name, ptr));
Can we look at the portion of the code where you delete texture objects?

SFML projects / Pentads, yet another Tetris clone
« on: August 14, 2011, 08:27:14 am »
"Pentads" is yet another tetris clone. Nothing special, maybe a bit more difficult to play. Blocks are harder to fit. Meteorites do not let you relax.


The game binary pack (for Windows) is here: http://www.mediafire.com/?d29pfm9jff9zn8m

License is simple. The game is free of charge. Do what you want with it except selling and removing copyright note.

Free music and sounds were borrowed from pacdv.com (see the following terms of use).  

TERMS OF USE: You may use the sound effects on this web site free of charge in your video, film, audio and multimedia productions but DO NOT e-sell them, post on a web site for download, or link directly to individual sound files. If you use these sound effects, please consider linking back to this site but you don't have to. http://www.pacdv.com/sounds

This game was mainly used as a test application for my game framework. Though it lacks important parts of user interface, namely settings dialog, save result dialog, message windows, etc., it is quite playable. It already has music and sound effects. I intend to finish this game as soon as possible (maybe ;-)).
In spite of lack of settings dialog, one can change a few options by editing the configuration file manually. In the bottom part of this file relevant tags of the configuration are described.
The game framework used for developing "Pentads" is not finished yet as well. For now GUI has only a few widgets: button, panel, picture and label. The GUI supports widget focus tab-order. A user can press Tab key to move focus forward and Shift-Tab to move focus backward. Pressing Enter against focused widget is equivalent to its left-mouse-clicking. For now only two buttons in the main menu have click event handlers: Game and Quit. Besides, the game can not be paused.

How to change options in the file config.xml.

Audio subsystem. One can switch on/off music and sounds and set volumes.

Code: [Select]
<subsystem name="audio">
  <item key="useMusic" value="true" />
  <item key="useSounds" value="true" />
  <item key="volumeMusic" value="50" />
  <item key="volumeSounds" value="50" />

Game look. Default skin is "Haze". Who finds it too dull can choose a skin from the list: "Ocean", "Grass", "Lilac", "Honey", "Haze", "Pink", "Navy".
Code: [Select]
<subsystem name="game">
  <item key="look" value="Haze" />
Key map. Sorry, so far it's somewhat inconvenient to change default keys. A user has to look at SFML source to be able to manually change constants for keys. Key assignments can be seen in the main game window (label "Keys").

The following aliases for game control keys are used:

"left2" is assigned to "LEFT"
"right2" .. to "RIGHT"
"up2" .. to "ROTATE"
"down2" .. to "DOWN"
"jump2" .. to "DROP"

Code: [Select]
<subsystem name="keymap">
  <item key="left2" value="291" />
  <item key="right2" value="292" />
  <item key="up2" value="293" />
  <item key="down2" value="294" />
  <item key="jump2" value="277" />
  <item key="menu" value="256" />
  <item key="pause" value="320" />

Window / Event sample rate
« on: June 28, 2011, 05:52:55 pm »
I'm wondering if I've done something wrong

1. You create the window in the heap using new but forget to destroy it with delete.
2. Using goto is a first step to spaghetty code.  :)

General / Adding a Title screen / organizing code
« on: June 22, 2011, 05:43:29 am »
One of possible ways to organize a graphical application is using "application state" paradigm and scenes binded to each state. For example you can create states like:
1. Intro (title, app description, credits etc.)
2. Menu (main gui)
3. Settings
4. Game (the game process itself)
5. Game Over
6. .... whatever you wish
The states may switch when specified events occur:
Intro->Menu switches when intro time expires
Menu->Settings (or Game) switches when a user clicks a menu button

Graphics / why is my sprite blurred?
« on: June 22, 2011, 05:14:42 am »
For jpeg or bmp images you can mask the part of the image that must be transparent using Image::CreateMaskFromColor(..) method.

Graphics / Does anyone have a .pic file?
« on: June 12, 2011, 01:30:30 pm »
You can get pic file out of, say, jpeg using convertion in a very popular viewer XnView. It supports more than 400 file formats, pic files being in that number.

Graphics / Fonts not loading
« on: May 23, 2011, 01:04:55 pm »
Are you sure you really cant load the font? May be you are trying to use a temporary instance of a successfully loaded font in an instance of a text that lives longer than the font it refers to.

General / Memory Leaks?
« on: May 10, 2011, 12:56:32 pm »
There are 1000 chances of making leaks implicitly. For example while initializing static member variables. To do this one just need to compile a unit with a leak.

Lets create a simple header file "a.h":

Code: [Select]
class B
  int* a;


  B(int val) { a = new int(val); }

  ~B() { // forget to destroy a }

class A
static B b;

And "a.cpp" that is added to the project:

Code: [Select]
#include "a.h"

B A::b = 10;

Finally the main() function that neither includes nor does anything. But we have 4-bytes leak due to initializing a static member.

Code: [Select]
int main(int argc, char* argv[])
  return 0;

I know this example seems too-oo-o unreal. I just wanted to show one of 1000 chanses. And to point that looking at one main() function may not help.

Graphics / Tint an Image
« on: March 14, 2011, 09:16:27 am »
I'm not sure I understand right what you mean by 'tinting an image' - changing RGB values?. You can create an image filled with a specific color. You can change the colors of pixels in an existing image.

Pages: [1] 2 3