TELEPORT.CPP
资源名称:tc3d.zip [点击查看]
上传用户:abcdshs
上传日期:2007-01-07
资源大小:1858k
文件大小:1k
源码类别:
游戏
开发平台:
Visual C++
- // (C) Copyright 1996-1997 by Anthony J. Carin. All Rights Reserved.
- #include "stdafx.h"
- #include "teleport.h"
- #include "levels.h"
- extern CString& getpath(CString& filename);
- Teleporter::Teleporter(short Level)
- : landscape((CString)"landscpe\teleport.img")
- {
- m_type = TELEPORTER;
- mLevelNum = Level;
- }
- void Teleporter::draw()
- {
- baseobject::draw();
- #ifdef EDITOR
- if (Game->LevelPtr()->selection)
- return;
- #else
- setcolor(RGB(random(256), random(256), random(256)));
- #endif
- if (Game->LevelPtr()->GuyLocation().distanceto(location()) < .5f)
- {
- Game->Landscapes()->save();
- Game->LevelPtr()->NewLevel();
- Game->SetLevelNum((short)(mLevelNum-1));
- }
- }