⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 worldobject.cpp

📁 c++游戏源码 素材文件 需要openAl32.dll可以在网上下载
💻 CPP
字号:
#include "LlamaWorks2d.h"

using namespace llamaworks2d;

#include "WorldObject.h"


world_object::world_object() :
    collisionWidth(0),
    collisionHeight(0),
    collidable(true),
    visible(true),
    next(NULL)
{
}


// Transform to world coordinates and render.
bool world_object::Render( invasion *theGame)
{
    return (true);
}


// Get a chance to update internal state every
//  frame.
bool world_object::Update( invasion *theGame)
{
    return (true);
}


void world_object::Hit( world_object &stationary)
{
}


bool world_object::Intersects(
    world_object &other)
{
    if (collidable==false ||
        other.collidable==false)
    {
        return (false);
    }
    if (worldPos.X() + collisionWidth <
        other.worldPos.X())
    {
        return (false);
    }
    if (worldPos.X() >
        other.worldPos.X() + other.collisionWidth)
    {
        return (false);
    }
    if (worldPos.Y() + collisionHeight <
        other.worldPos.Y())
    {
        return (false);
    }
    if (worldPos.Y() >
        other.worldPos.Y() + other.collisionHeight)
    {
        return (false);
    }
    return (true);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -