Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


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