Jump to content

  • Log In with Google      Sign In   
  • Create Account


kd7tck

Member Since 26 Aug 2012
Offline Last Active Jan 20 2014 10:26 PM
*****

#4979560 Unable to create a new vector

Posted by kd7tck on 12 September 2012 - 09:18 PM

Don't be scared to show us all your code.


#4978825 Design of a modern data driven renderer

Posted by kd7tck on 11 September 2012 - 02:39 AM

Look at this post http://www.gamedev.net/topic/630029-data-driven-renderer/ .

This is a lot of work, why are you doing this?

GameObject->RendererComponent->RenderCommand->Material->(textures, matrices etc...)?

Model your system after the collada file format, this will make it easier for you to import data later.


#4978399 Help with splitting new files.

Posted by kd7tck on 09 September 2012 - 04:00 PM

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.


#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.


#4977128 Unwanted behaviour in my space invaders game

Posted by kd7tck on 06 September 2012 - 03:25 AM

specifical?

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




PARTNERS