#include "StdAfx.h"
#include "Logic.h"
extern CGame *g_game;
extern float mx ; //鼠标的x,y值eddy->sizeof()
extern float my;
extern int TOLLGATE_ID;
bool iskkkk=false;
CLogic::CLogic(void)
{
move = 0.0f;
m_x = 0.0f;
m_y = 220.0f;
m_speed = 0;
speed_x = 0.0f;
speed_y = 0.0f;
speed_z = 0.0f;
Poise_y = 132.0f;
isdead = true;
isrun = false;
isplay = false;
norun = false;
speed_x1 = 0.0f;
speed_y1 = 0.0f;
speed_z1 = 0.0f;
m_case = 0;
m_Munber = 0;
for(int k = 0; k < 20; k++)
{
ge[k] = false;
}
}
CLogic::~CLogic(void)
{
}
// 逻辑处理
void CLogic::Screen_one()
{
Init();
speed();
Disappear();
// 老鼠 落水状态
g_game->toll_gate->m_ImageMouseone->SetZ(0.0f);
g_game->toll_gate->m_ImageCatone->SetZ(0.0f);
g_game->toll_gate->m_ImageCattwo->SetZ(0.0);
if (m_x <= -230)
{
g_game->toll_gate->m_ImageMouseone->SetColor(0X088888ff);
g_game->toll_gate->m_ImageMouseone->SetZ(-10.0f);
if (g_game->m_cwnd->temx[6] >= 370 && g_game->m_cwnd->temx[6] <= 450
&& g_game->toll_gate->m_isdeal == false)
{
g_game->toll_gate->m_ImageMousetwo->Render(170, 300);
g_game->toll_gate->m_ImageCatone->SetColor(0Xffffffff);
g_game->toll_gate->m_ImageCase->SetColor(0X088888ff);
g_game->toll_gate->m_ImageMousetwo->SetColor(0Xffffffff);
}
else
{
m_x = -230;
g_game->toll_gate->m_ImageMouseone->SetZ(-10.0f);
g_game->toll_gate->m_ImageMouseseven->Render(170, g_game->toll_gate->dy-50);
if (g_game->toll_gate->m_ImageMouseseven->GetFrame() == 13)
{
g_game->toll_gate->m_ImageMouseseven->SetFrame(10);
g_game->toll_gate->m_isdeal = true;
}
}
}
else
{
g_game->toll_gate->m_ImageMouseone->SetColor(0Xffffffff);
}
if(m_x <= -695/* && m_speed == 1*/)
{
g_game->toll_gate->m_ImageMouseone->SetZ(0.0f);
g_game->toll_gate->m_ImageMouseone->SetColor(0Xffffffff);
g_game->toll_gate->m_ImageMousetwo->SetColor(0X088888ff);
g_game->toll_gate->m_ImageCase->SetColor(0Xffffffff);
g_game->toll_gate->m_ImageCase->Render(m_x + 880, 330);
}
// 上跳过程
if (m_x <= -1200 && m_x >= -1250 )
{
if ( g_game->m_cwnd->temx[1] >= 1380 && g_game->m_cwnd->temx[1] <= 1480 )
{
m_x = -1200;
speed_x += 0.32f;
g_game->toll_gate->m_ImageMousethree->SetColor(0xffffffff);
g_game->toll_gate->m_ImageMousefuor->SetColor(0xffffffff);
if (speed_y <= 260 )
{
speed_y++;
Poise_y += 1.0f;
//g_game->toll_gate->m_ImageMouseone->SetColor(0X088888ff);
g_game->toll_gate->m_ImageMouseone->SetZ(-0.5);
g_game->m_cwnd->iste[1] = true;
g_game->toll_gate->m_ImagePoise->SetZ(0.0f);
g_game->toll_gate->m_ImagePoise->Render(m_x + 1420, Poise_y);
g_game->toll_gate->dy = 260;
isplay = true;
if (Poise_y >= 270 && g_game->toll_gate->m_isdeal == false)
{
g_game->toll_gate->m_ImageMousethree->Render(g_game->toll_gate->dx+speed_x,g_game->toll_gate->dy-speed_y);
}
Poise_y = 270.0f;
}
if (speed_y == 260 )
{
speed_x = 0;
speed_y = 261;
}
if (speed_y == 261 && speed_x <= 25)
{
g_game->toll_gate->m_ImageMouseone->SetColor(0X088888ff);
g_game->toll_gate->m_ImageMousefuor->Render(234 + speed_x, 29 + speed_x*2);
g_game->toll_gate->m_ImageMousethree->SetColor(0X088888ff);
}
if (speed_y == 261 && speed_x >= 25)
{
m_x = -1300;
isrun =true;
}
}
}
if (isplay == true)
{
g_game->toll_gate->m_ImageMouseeight->Render(m_x + 1350, 290);
}
if (isrun == true)
{
if (m_x <= -1280 && m_x>=-1480 )
{
speed_z+=0.092f;
g_game->toll_gate->dy = 84.5f + speed_z;
//g_game->toll_gate->m_ImageMouseone->SetColor(0Xffffffff);
g_game->toll_gate->m_ImageMouseone->SetZ(0.0f);
}
if ( m_x <= -1480 &&m_x >= -1520 )
{
speed_z = 0;
}
if ( m_x <= -1480 )
{
speed_z += 0.10f;
g_game->toll_gate->dy = 105.74f - speed_z;
}
}
if (m_x <= -1400.0f && isrun == false)
{
// 被猫抓住
m_x = -1400;
g_game->toll_gate->m_ImageCattwo->Render(m_x + 1550, m_y);
g_game->toll_gate->m_ImageCatone->SetColor(0X088888ff);
g_game->toll_gate->m_ImageMouseone->SetColor(0X088888ff);
if (g_game->toll_gate->m_ImageCattwo->GetFrame() == 3)
{
g_game->toll_gate->m_ImageMouseone->SetZ(-10.0f);
g_game->toll_gate->m_isdeal = true;
g_game->toll_gate->m_ImageCatone->SetZ(-10.0);
g_game->toll_gate->m_ImageCattwo->SetZ(-10.0);
}
}
if(m_x <= -1700 )
{
m_x =-1725;
if (norun == false)
{
speed_x1 +=0.5f;
g_game->toll_gate->dx-=0.7f;
g_game->toll_gate->dx=195;
g_game->toll_gate->dy=150 + speed_x1;
//g_game->toll_gate->m_ImageMouseone->SetColor(0X088888ff);
g_game->toll_gate->m_ImageMouseone->SetZ(-0.5);
g_game->toll_gate->m_ImageMousefuor->Render(g_game->toll_gate->dx,g_game->toll_gate->dy);
}
}
if (speed_x1 >= 90 && speed_x1 <= 100 && g_game->m_cwnd->temx[3]>=1850&&g_game->m_cwnd->temx[3]<=2000)
{
speed_x1 = 90;
if (speed_y1 <= 50)
{
speed_y1 +=0.5;
g_game->toll_gate->m_ImageMousefuor->SetColor(0X088888ff);
g_game->toll_gate->m_ImageMousethree->Render(g_game->toll_gate->dx+speed_y1,260-speed_y1);
}
if(speed_y1 >=50 )
{
if (speed_z1 <=28)
{
speed_z1 +=0.15f;
}
norun = true;
//g_game->toll_gate->m_ImageMouseone->SetColor(0X088888ff);
g_game->toll_gate->m_ImageMouseone->SetZ(-0.5);
g_game->toll_gate->m_ImageMousefuor->Render(260+speed_z1,210+speed_z1*4);
g_game->toll_gate->m_ImageMousefuor->SetColor(0Xffffffff);
}
if (speed_z1 >= 28 )
{
g_game->toll_gate->m_ImageMousefuor->SetColor(0X088888ff);
//g_game->toll_gate->m_ImageMouseone->SetColor(0Xffffffff);
g_game->toll_gate->m_ImageMouseone->SetZ(0.0);
g_game->toll_gate->dy = 320;
m_speed = 0;
m_x = -1750;
}
}
if(speed_x1 >= 145 )
{
g_game->toll_gate->m_ImageMousesix->Render(180, 340);
g_game->toll_gate->m_ImageMousefuor->SetColor(0x088888ff);
g_game->toll_gate->m_ImageMousefuor->SetColor(0X088888ff);
if (g_game->toll_gate->m_ImageMousesix->GetFrame() ==1)
{
g_game->toll_gate->m_isdeal = true;
g_game->m_cwnd->iste[1] = false;
isrun = false;
isplay = false;
norun = false;
speed_x = 0;
speed_y = 0;
speed_z = 0;
speed_x1= 0;
speed_y1= 0;
speed_z1= 0;
Poise_y = 132.0f;
g_game->toll_gate->dy = 291;
g_game->toll_gate->dx = -35;
g_game->toll_gate->m_ImageMouseone->SetZ(0.0f);
g_game->toll_gate->m_ImageCatone->SetZ(0.2f);
}
}
if (m_x <= -1750.0f )
{
m_x =-1725;
if (g_game->toll_gate->dx <= 380)
{
m_speed = 0;
}
if (g_game->toll_gate->dx>=600)
{
if(!iskkkk)
{
if (g_game->toll_gate->anhe())
{
iskkkk=true;
TOLLGATE_ID = TOLLGATE_IDTHREE;
g_game->toll_gate->m_ImageMouseclip[0]->SetFrame(0);
g_game->toll_gate->m_ImageMouseclip[1]->SetFrame(0);
g_game->toll_gate-> m_ImageMouseclip[0]->Stop();
g_game->toll_gate-> m_ImageMouseclip[1]->Stop();
g_game->toll_gate->m_isdeal = true;
m_x = 0;
}
}
}
}
}
// 奶酪的吃取
void CLogic::Disappear()
{
if (m_x <= -25 && m_x >= -26)
{
g_game->toll_gate->m_ImageCheese[0]->SetColor(0X088888ff);
if (!ge[0])
{
m_case += 25;
ge[0] = true;
}
}
if (m_x <= -135 && m_x >= -136)
{
g_game->toll_gate->m_ImageCheese[1]->SetColor(0X088888ff);
if (!ge[1])
{
m_case += 25;
ge[1] = true;
}
}
if (m_x <= -910 && m_x >= -911)
{
g_game->toll_gate->m_ImageCheese[2]->SetColor(0X088888ff);
if (!ge[2])
{
m_case += 25;
ge[2] = true;
}
}
if (m_x <= -1030 && m_x>= -1031)
{
g_game->toll_gate->m_ImageCheese[3]->SetColor(0X088888ff);
if (!ge[3])
{
m_case += 25;
ge[3] = tr
没有合适的资源?快使用搜索试试~ 我知道了~
引擎hge 项目游戏
共109个文件
png:57个
h:24个
cpp:10个
4星 · 超过85%的资源 需积分: 10 160 下载量 56 浏览量
2009-06-29
10:59:51
上传
评论 1
收藏 1.83MB RAR 举报
温馨提示
一个用hge 引擎写的小游戏 Tom and Jerry ,游戏共两关,里面有代码,如果感兴趣的朋友,可以看看!
资源详情
资源评论
资源推荐
收起资源包目录
引擎hge 项目游戏 (109个子文件)
libhge.a 3KB
Logic.cpp 15KB
Tollgate.cpp 14KB
Cwnd.cpp 10KB
Game_begin.cpp 4KB
logo.cpp 2KB
Tom and Jerry.cpp 1KB
Game.cpp 1KB
PlayMusic.cpp 586B
stdafx.cpp 208B
Mouse.cpp 102B
harrow.cur 766B
Thumbs.db 126KB
Thumbs.db 65KB
hge.dll 163KB
bass.dll 91KB
Tom and Jerry.exe 100KB
font1.fnt 2KB
hge.h 17KB
Tollgate.h 5KB
hgeguictrls.h 4KB
hgecolor.h 4KB
hgeparticle.h 3KB
hgegui.h 2KB
hgefont.h 2KB
hgesprite.h 2KB
hgeresource.h 2KB
hgevector.h 2KB
hgedistort.h 2KB
stdafx.h 2KB
hgeanim.h 2KB
Cwnd.h 887B
hgerect.h 804B
Game_begin.h 800B
Resource.h 705B
hgestrings.h 697B
logo.h 621B
Logic.h 575B
Game.h 275B
PlayMusic.h 248B
Mouse.h 88B
Tom and Jerry.h 39B
small.ico 23KB
Tom.ico 23KB
hgehelp.lib 156KB
hge.lib 2KB
hge.lib 1024B
Tom and Jerry.log 411B
场景.PNG 800KB
地图.png 122KB
开始.png 99KB
死亡窗口1.png 51KB
死亡窗口2.png 51KB
画布内容.png 41KB
阴影.png 29KB
踩板.png 25KB
衣服箱.png 15KB
夹子.png 14KB
弹床.png 13KB
particles.png 12KB
滑板动画1.png 11KB
鞋子.png 10KB
font1.png 10KB
猫和老鼠.png 8KB
滑板.png 8KB
移动.png 7KB
猫看电视.png 7KB
遥控器.png 6KB
砝码.png 6KB
透明框.png 5KB
窗口.png 5KB
伞.png 5KB
小船.png 5KB
滑板动画.png 5KB
游戏说明.png 5KB
蝴蝶.png 4KB
落水.png 4KB
猫睡.png 4KB
火柴盒.png 4KB
奶酪.png 4KB
电视动画.png 4KB
胜利.png 3KB
后走.png 3KB
墙角1.png 3KB
翻动.png 3KB
瓜瓢.png 3KB
锅铲.png 3KB
说明.png 2KB
钻地.png 2KB
蜡烛.png 2KB
help.png 2KB
光圈.png 2KB
画轴1.png 1KB
下落.png 1KB
画轴.png 1KB
浏览.png 1KB
play.png 1KB
死亡.png 817B
GO!.png 793B
放置火柴.png 699B
共 109 条
- 1
- 2
百里小苏苏
- 粉丝: 4
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论2