Why are you using two namespaces, there could be name collisions going on. Use sf:: for every sf namespace object you want to call, and get rid of line 7.
Why are you hiding the include names from us, if not then why are there empty includes in your code?
Do not name a texture Shape, this could be causing name collisions if you import the Graphics library from sfml.
You need to organize the game into states, state transitions are triggered by global events mapped to other states.
How did you split up the files, show us how you did it. That way we can give you more detailed information.
- Viewing Profile: Reputation: kd7tck
Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics
Community Stats
- Group Members
- Active Posts 110
- Profile Views 1,372
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
604
Excellent
User Tools
Contacts
kd7tck hasn't added any contacts yet.
Latest Visitors
#4978399 Help with splitting new files.
Posted by kd7tck
on 09 September 2012 - 04:00 PM
#4978392 How do i make a level with tiles?
Posted by kd7tck
on 09 September 2012 - 03:32 PM
Have a look at http://www.gamedev.net/topic/622801-sfml-tile-maps/. If you want specific answers like code, then you will have to post your program.
#4977532 Stuck in late development
Posted by kd7tck
on 07 September 2012 - 02:36 AM
To save time debugging in the future, design your code around making it easy to debug latter on. The following is a list of things to impliment in future projects to reduce the amount of time spent debugging. (You might need to google some of the terminology used in these steps)
1) Logging of all input, output, events, calculations and errors to an output file.
2) Write out a game design document before coding game, based on this document write out every possible use case, then every possible test case.
3) Use a unit testing framework, apply all assertions from test cases made earlier in step 2.
4) Use a documentation system like doxygen, helps you learn to better comment code.
1) Logging of all input, output, events, calculations and errors to an output file.
2) Write out a game design document before coding game, based on this document write out every possible use case, then every possible test case.
3) Use a unit testing framework, apply all assertions from test cases made earlier in step 2.
4) Use a documentation system like doxygen, helps you learn to better comment code.
#4977128 Unwanted behaviour in my space invaders game
Posted by kd7tck
on 06 September 2012 - 03:25 AM
specifical?
ALLEGRO_EVENT_KEY_UP
ALLEGRO_EVENT_KEY_UP
#4973580 Making Screen follow the player?
Posted by kd7tck
on 26 August 2012 - 03:43 PM
Don't follow the character. Have the character in a fixed position, and move the world behind the character instead.
If however you have your heart set on it, then write a map panning function. I assume you are using swing since you did not specify otherwise.
To do it, seperate your background drawing over to a texture, one that is sized about N^2 larger than the window resolution. Then draw a subrectangle of it over to the window canvas, and only flip once v-sync is ready. The key to making it center on the character is setting the subrectangle to the following coordinates.
X = CHARX - ((WINWIDTH - CHARWIDTH) / 2)
Y = CHARY - ((WINHEIGHT - CHARHEIGHT) / 2)
Make certain that Character is always within the following bounds of the texture, otherwise shift the map to compensate.
( ((WINWIDTH - CHARWIDTH) / 2) < x < TEXTWIDTH - ((WINWIDTH - CHARWIDTH) / 2) )
( ((WINHEIGHT - CHARHEIGHT) / 2) < y < TEXTHEIGHT - ((WINHEIGHT - CHARHEIGHT) / 2) )
If however you have your heart set on it, then write a map panning function. I assume you are using swing since you did not specify otherwise.
To do it, seperate your background drawing over to a texture, one that is sized about N^2 larger than the window resolution. Then draw a subrectangle of it over to the window canvas, and only flip once v-sync is ready. The key to making it center on the character is setting the subrectangle to the following coordinates.
X = CHARX - ((WINWIDTH - CHARWIDTH) / 2)
Y = CHARY - ((WINHEIGHT - CHARHEIGHT) / 2)
Make certain that Character is always within the following bounds of the texture, otherwise shift the map to compensate.
( ((WINWIDTH - CHARWIDTH) / 2) < x < TEXTWIDTH - ((WINWIDTH - CHARWIDTH) / 2) )
( ((WINHEIGHT - CHARHEIGHT) / 2) < y < TEXTHEIGHT - ((WINHEIGHT - CHARHEIGHT) / 2) )
- Home
- » Viewing Profile: Reputation: kd7tck

Find content