Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Analizer

Member Since 09 Sep 2012
Offline Last Active Mar 27 2014 09:50 AM

Posts I've Made

In Topic: allegro 4 object interaction + object collision

17 April 2013 - 01:36 AM

Thanks for your reply.

 

Another issue I have got with my game is that the character goes outside the window box. The default window size of my game is 800x600 pixels at one time. If you check the void moveCharacter function you can see the camera class taking place. The problem is the character can go to the right and bottom with no end. I have added this bit of code to main.cpp:

 

if ( character_x < 30 )
character_x = 30;
else if (character_x >800 )
character_x = 800;

 

The character stops at 800 pixels.

 

However.

 

if ( character_x < 30 )
character_x = 30;
else if (character_x >1200 )
character_x = 1200;

 

If I change it to a value that is higher than the window size (800x600) no collision is taking place. Any suggestion on how to fix that when the character reaches 1800 pixels accross?


PARTNERS