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 - svladd Cjelik

Pages: [1]
1
Graphics / Re: So close ...I just need a little push please :3
« on: November 29, 2012, 05:22:25 am »
Thanks friend.  I got it working like a charm.
 
I honestly thought I had to use pointers because of scope ...alas I did not.  My draw function works perfectly with a simple pass by reference.
 
Again thank you.
 
I shall endevour to heed your advice.

2
Graphics / So close ...I just need a little push please :3
« on: November 29, 2012, 02:56:26 am »
First off, thank you all so much for your help and advice so far.
 
Yes, I am learning C++ as I go -and I find the best way is just to jump right in the deep end.
 
I have been programming in C++ for about 6 months now and get the procedural stuff.  I also have a BASIC understanding of pointers, classes and linked lists and so on -I have played around with the old Clock::setTime() from the two text books I have, and they have been holding my hand every step of the way so far.
 
The thing is, I need just a little help please.
 
My code is here https://gist.github.com/4166189

...I am using SFML 2.0RC, and I have stripped the code in that post to the bare bones of exactly what is troubling me ...that is I have removed the grand bulk of the funtions and so on...
 
I have asked here before, but this time I have refined my question somewhat.
 
Lines 10, 12, and 14 - 17 of LoadMaps.cpp

Is the function definition correct?  I think I should be using the -> operator not the . operator though I can't seem to get the syntax right for the prototype.

Line 7 of LoadMaps.h

Is this the correct information if I want to pass the addresses of my data by reference?  Or are the ampisands not required because the pointers are addresses?

Line 28 of main.cpp

How should I call the function.
 
Basically yes, I am asking for the correct syntax, and for you to write it for me if you will.  As for understanding it, I will get there when I see it working =]
 
Thank you so very much for your patience.

3
Got it, thank you both for your help.
 
I simply put both the functions into a class, and created an object which I then passed about the place.
 
OO 101.

4
Hey everyone, and thanks in advance.
 
I know my question is not SFML specific, but more about C++, but I thought you may be able to help me anyways.
 
Part of my code is here https://gist.github.com/4123800
 
I have not included all the files, because the program is HUGE. It's a roguelike game ...and I have been working on the data for some time, and I am putting it together to render and play with for the first time now and my problem is with the drawFloor() function.

The call itself is right at the end of main().

I know I need to cast the objects and send the pointers as parameters, but I cannot find the correct syntax.

sf::Texture floortile1 ---can be found on line 9 of floorsprites.cpp sf::RenderWindow window ---can be found on line 39 of main.cpp

Also, I have left the two commas in the prototype, the call, and the function itself where my parameters need to go.

Again, thanks in advance.

Also, I will be here if anyone needs to see more code.

5
General / Re: AW: Re: Turn basesd games and sf::Keyboard
« on: November 03, 2012, 01:02:13 pm »
Ehrm have you ever worked wirh SFML? ;)
Such a function does not exist in sf::Keyboard. But one can use events with relased.

About turn based, I wasn't referring to the game itself, bit your statement made it seem like the mechnism should be called turn based. ;)

Sorry friend, no.  I only started with SMFL this morning.  Up until now I have been using nCurses.  It was fantastic for ironing out my game code, but I am looking now to migrate away from the console and into the world of graphics.  It is just a matter of learing the librarys and methods available really.
 
Thank you for your help so far though!

6
General / Re: Turn basesd games and sf::Keyboard
« on: November 03, 2012, 12:59:33 pm »
Quote
In turn-based games, game flow is partitioned into well-defined and visible parts, called turns. A player of a turn-based game is allowed a period of analysis (sometimes bounded, sometimes unbounded) before committing to a game action, ensuring a separation between the game flow and the thinking process, which in turn presumably leads to better choices. Once every player has taken his or her turn, that round of play is over, and any special shared processing is done. This is followed by the next round of play. In games where the game flow unit is time, turns may represent such things as years, months, weeks or days.

From:
http://en.wikipedia.org/wiki/Turns,_rounds_and_time-keeping_systems_in_games

This is exactly what I want.  A roguelike.  Turn based.  The player moves one tile, up down left or right ...with as much time to wait between turns as he or she likes.  I will look into isKeyReleased :3

7
General / Re: Turn basesd games and sf::Keyboard
« on: November 03, 2012, 10:10:12 am »
I'm sorry, but for clarification -how is a roguelike game not turn  based?  What is the common usage of the term?  I want to press the left key, and have my sprite move one tile to the left and stay there.  At the moment I press left and the game cycles through 12 or so turns.
 
Thanks :3

8
General / Turn basesd games and sf::Keyboard
« on: November 03, 2012, 05:00:57 am »
Hey everyone, and thanks in advance.
 
First off, I searched for turn based and no results came up.
 
I know this is a very elementary question, but I need a little help.  I am currently using  (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) in my gameloop for movement ...but I am making a roguelike, and this function is not working for me.
 
What I need is perhaps a boolean function or something for each keypress -I am not sure.
 
In case I have not been clear -I need one "Left" keypress, to move one tile to the left only.  As it stands, pressing the key even for an instant uses up far too many "turns".
 
I hope that makes sense to you,

Kind regards,

Svladd

Pages: [1]
anything