Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 1 more developer from Canada and 12 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!


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