Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Returns true of an object is touching a screen edge.
- //Specify the size of the object in pixels, or pass HitWidth, HitHeight; or EffectWidth, EffectHeight.
- bool OnScreenEdge(lweapon l, int width, int height){
- if ( l->X <= SCREEN_LEFT ) return true;
- if ( ( l->X + width ) >= SCREEN_RIGHT ) return true;
- if ( l->Y <= SCREEN_TOP ) return true;
- if ( ( l->Y + height ) >= SCREEN_BOTTOM ) return true;
- return false;
- }
- bool OnScreenEdge(eweapon l, int width, int height){
- if ( l->X <= SCREEN_LEFT ) return true;
- if ( ( l->X + width ) >= SCREEN_RIGHT ) return true;
- if ( l->Y <= SCREEN_TOP ) return true;
- if ( ( l->Y + height ) >= SCREEN_BOTTOM ) return true;
- return false;
- }
- bool OnScreenEdge(npc l, int width, int height){
- if ( l->X <= SCREEN_LEFT ) return true;
- if ( ( l->X + width ) >= SCREEN_RIGHT ) return true;
- if ( l->Y <= SCREEN_TOP ) return true;
- if ( ( l->Y + height ) >= SCREEN_BOTTOM ) return true;
- return false;
- }
- bool OnScreenEdge(item l, int width, int height){
- if ( l->X <= SCREEN_LEFT ) return true;
- if ( ( l->X + width ) >= SCREEN_RIGHT ) return true;
- if ( l->Y <= SCREEN_TOP ) return true;
- if ( ( l->Y + height ) >= SCREEN_BOTTOM ) return true;
- return false;
- }
- bool OnScreenEdge(ffc l, int width, int height){
- if ( l->X <= SCREEN_LEFT ) return true;
- if ( ( l->X + width ) >= SCREEN_RIGHT ) return true;
- if ( l->Y <= SCREEN_TOP ) return true;
- if ( ( l->Y + height ) >= SCREEN_BOTTOM ) return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement