#ifndef _GameGUI
#define _GameGUI
#include "GUIComponent.h"
#include "Button.h"
#include "Manager.h"
#include "GraphicalUserInterface.h"
#include "GameStats.h"
#include "AIAircraft.h"
#include "PlayerAircraft.h"
#include "ArcadeGame.h"
#import <MediaPlayer/MediaPlayer.h>
#include "TracerWeapon.h"
//Large code base for Above & Beyond's game GUI
class IncomeDisplay : public GUIComponent
{
public:
IncomeDisplay()
{
texturePath = "EconomyHeader";
scale = Vector(71, 480);
useResolution = true;
resolution = Vector(128, 512);
layer = 7;
showTitle = false;
ghost = true;
}
void drawImage()
{
GUIComponent::drawImage();
manager.text.draw("$" + utility.stringOf(gameStats.player.getCredits()), getPosition() + Vector(48 + 12, 15), Color(), 12, false);
manager.text.draw("^" + utility.stringOf((int)gameStats.player.getEnergyLevel()), getPosition() + Vector(48, 15), Color(), 11, false);
}
};
class EditorIncomeDisplay : public IncomeDisplay
{
public:
EditorIncomeDisplay()
{
texturePath = "IncomeDisplay";
scale = Vector(34, 110);
useResolution = false;
layer = 50;
showTitle = false;
ghost = true;
}
void drawImage()
{
GUIComponent::drawImage();
manager.text.draw("$" + utility.stringOf(gameStats.player.getCredits()), getPosition() + Vector(12 + 10, 4), Color(), 12, false);
manager.text.draw("^" + utility.stringOf((int)gameStats.player.getEnergyLevel()), getPosition() + Vector(10, 4), Color(), 11, false);
}
};
class GUIInGameMenu : public GUIComponent
{
public:
bool ending;
GUIInGameMenu()
{
hidden = false;
texturePath = "BlackSquareBig";
scale = Vector(250, 190);
color.a = 1;
blendFunc = ALT_BLEND;
location = Vector(0, -0.5 * scale.y);
alignment = Vector(1, 0.5);
showTitle = false;
layer = 9;
ending = false;
}
void init()
{
GUIComponent::init();
float spacing = 5;
Vector buttonSize = Vector(30, 150);
float top = 224;
GUIComponentTag* button = add(new Button("Options", "BlackRectangleMed", buttonSize, true));
button->ptr->alignment = Vector(0, 0.5);
button->ptr->location = Vector(top - buttonSize.x * 1, -0.5 * button->ptr->scale.y);
button = add(new Button("Calibrate", "BlueRectangleMed", buttonSize, true));
button->ptr->alignment = Vector(0, 0.5);
button->ptr->location = Vector(top - buttonSize.x * 2 - spacing, -0.5 * button->ptr->scale.y);
button = add(new Button("Quit", "BlueRectangleMed", buttonSize, true));
button->ptr->alignment = Vector(0, 0.5);
button->ptr->location = Vector(65, -0.5 * button->ptr->scale.y);
if(NSClassFromString(@"MPMediaPickerController") != nil)
{
button = add(new Button("Music", "MusicButton", Vector(40, 40), false));
}
else
{
button = add(new Button("Music", "AudioButton", Vector(40, 40), false));
}
button->ptr->alignment = Vector(0, 0);
button->ptr->location = Vector(8, scale.y-8-40);
add(new Button("Back", "BackButton", Vector(30, 70), false), Vector(0, 0));
gameStats.glView.calibrationsLeft = 3;
}
void update(float dt)
{
GUIComponent::update(dt);
if(ending)
{
location.x = math.clamp(-280, location.x + 2000 * dt, 300);
if(location.x >= 300)
{
endOfLife = true;
}
}
else
{
location.x = math.clamp(-280, location.x - 700 * dt, 300);
}
}
~GUIInGameMenu()
{
}
void notifyEvent(string in, GUIComponentTag* source);
};
class WaveInGameMenu : public GUIInGameMenu
{
public:
WaveInGameMenu()
{
}
void notifyEvent(string in, GUIComponentTag* source)
{
if(in == "Quit00")
{
manager.audio.playSound("Back");
WaveArcadeGame* wag = dynamic_cast<WaveArcadeGame*> (gameStats.getGameType());
if(wag)
wag->endGame();
}
else
{
GUIInGameMenu::notifyEvent(in, source);
}
}
};
class GUIInGameInterface : public GUIComponent
{
public:
GUIComponentTag* menu;
GUIComponentTag* footer;
GUIInGameInterface()
{
menu = 0;
scale = 0;
location = 0;
showTitle = false;
footer = 0;
}
void init()
{
GUIComponent::init();
GUIComponentTag* header = GUI.add(new Button("Menu", "GameHeader", Vector(30, 60), false), Vector(320-30, 480/2 - 60/2));
header->ptr->layer = 10;
header->ptr->delegate = tag;
footer = GUI.add(new Button("Menu", "GameFooter", Vector(30, 60), false), Vector(0, 480/2 - 60/2));
footer->ptr->layer = 10;
footer->ptr->delegate = tag;
footer->ptr->ghost = true;
}
void update(float dt);
void draw()
{
// if(gameStats.player.aircraft && gameStats.player.aircraft->ptr)
// {
// PlayerAircraft* unit = dynamic_cast<PlayerAircraft*>(gameStats.player.aircraft->ptr);
//
// if(unit)
// {
// if(unit->target)
// footer->ptr->shouldDraw = true;
// else
// footer->ptr->shouldDraw = false;
// }
// }
GUIComponent::draw();
}
void click(bool down, int button);
void notifyEvent(string in, GUIComponentTag* source)
{
if(in == "Menu00")
{
if(!menu || !menu->ptr)
{
gameStats.setPaused(true);
menu = GUI.add(new GUIInGameMenu);
}
else
{
if(menu && menu->ptr)
{
gameStats.setPaused(false);
menu->ptr->endOfLife = true;
}
}
}
}
};
class WaveInGameInterface : public GUIInGameInterface
{
public:
void notifyEvent(string in, GUIComponentTag* source)
{
if(in == "Menu00")
{
if(!menu || !menu->ptr)
{
gameStats.setPaused(true);
menu = GUI.add(new WaveInGameMenu);
}
else
{
if(menu && menu->ptr)
{
gameStats.setPaused(false);
menu->ptr->endOfLife = true;
}
}
}
}
};
class ArcadeRingsInterface : public GUIInGameInterface
{
public:
ArcadeRingsInterface()
{
}
// void draw()
// {
// GUIComponent::draw();
// }
};
class StoreItem : public GUIComponent
{
public:
bool scrolling;
ChipInfo info;
int iconID;
int iconBGID;
int overlayID;
bool locked;
bool active;
StoreItem(ChipInfo in)
{
info = in;
scale = Vector(40, 218);
resolution = Vector(64, 256);
useResolution = false;
showTitle = false;
locked = info.energyLevel > gameStats.player.getEnergyLevel();
#if TARGET_IPHONE_SIMULATOR
locked = false;
#endif
active = false;
texturePath = "StoreItem";
scrollEnabled = true;
titleScale = 10;
titleOffset.x = 12;
iconID = -1;
iconBGID = -1;
focusTexturePath = "ButtonHighlight";
useFocusTexture = false;
}
void init()
{
GUIComponent::init();
iconID = manager.texture.add(info.iconPath);
iconBGID = manager.texture.add("EditorItem");
overlayID = manager.texture.add("EditorCircleOverlay");
}
void click(bool down, int b);
void drawImage()
{
GUIComponent::drawImage();
if(locked)
{
manager.text.draw("Not Enough", getPosition() + scale/2.0 + Vector(5, -30), Color(1,1,1,1), 11, true);
manager.text.draw("Energy", getPosition() + scale/2.0 + Vector(-5, -30), Color(1,1,1,1), 11, true);
manager.text.draw("^" + utility.stringOf(info.energyLevel), getPosition() + scale/2.0 + Vector(0, 60), Color(1,1,1,1), 11, false);
}
else
{
manager.model.defaults.drawQuad(getPosition() + Vector(scale.x/2 - 15, scale.y - 40), Vector(30, 30), info.iconColor, 0, NORM_BLEND, false, true, iconBGID, 0, 1, false);
manager.model.defaults.drawQuad(getPosition() + Vector(scale.x/2 - 15, scale.y - 40), Vector(30, 30), Color(), 0, NORM_BLEND, false, true, iconID, 0, 1, false);
manager.model.defaults.drawQuad(getPosition() + Vector(scale.x/2 - 15, scale.y - 40), Vector(30, 30), Color(), 0, NORM_BLEND, false, true, overlayID, 0, 1, false);
manager.text.draw(info.name, getPosition() + Vector(20, 10), Color(1,1,1,1), 10, false);
// manager.text.draw(utility.stringOf(info.cost) + " Credits", getPosition() + Vector(5, 60), Color(1,1,1,1), 10, false);
}
if(active)
{
manager.model.defaults.drawQuad(getPosition(), scale, Color(1, 1, 1, 1), 0, ADD_BLEND, false, true, focussedTextureID, texturePan, Vector(1), true);
}
}
void notifyEvent(st
没有合适的资源?快使用搜索试试~ 我知道了~
iOS实例开发源码——jshmrsn-Above---Beyond-Air-Combat-416b529.zip
共1218个文件
obj:347个
idg:343个
png:176个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 21 浏览量
2023-07-02
15:13:07
上传
评论
收藏 32.19MB ZIP 举报
温馨提示
iOS实例开发源码——jshmrsn-Above---Beyond-Air-Combat-416b529.zip
资源推荐
资源详情
资源评论
收起资源包目录
iOS实例开发源码——jshmrsn-Above---Beyond-Air-Combat-416b529.zip (1218个子文件)
Flyby.caf 821KB
Victory.caf 596KB
LargeCannon.caf 341KB
Alarm1.caf 337KB
Chime.caf 282KB
EngineSound.caf 274KB
LaserBurn.caf 262KB
RocketFire.caf 262KB
BackChime.caf 251KB
Power.caf 240KB
SelectChime.caf 233KB
Explosion.caf 217KB
Select.caf 152KB
Shotgun.caf 136KB
Crash.caf 105KB
GunShot2.caf 93KB
Crash2.caf 93KB
Hit.caf 88KB
Crash3.caf 77KB
Grenadelaunch.caf 68KB
Back.caf 62KB
Laser.caf 59KB
SmallLazer.caf 55KB
LowPop.caf 43KB
GunShot1.caf 23KB
GauntletCTrack.cmp 36KB
ArcadeRingWorldA.cmp 33KB
GauntletTrack.cmp 33KB
GauntletBTrack.cmp 25KB
CliffsB1.cmp 20KB
TropicaH1.cmp 17KB
DesertE1.cmp 17KB
CliffsC1.cmp 17KB
DesertA1.cmp 17KB
CliffsD1.cmp 17KB
DesertC1.cmp 16KB
TropicaG1.cmp 16KB
DesertH1.cmp 16KB
VolcanoC1.cmp 16KB
TropicaB1.cmp 16KB
SharpA1.cmp 16KB
TropicaA1.cmp 16KB
TropicaE1.cmp 16KB
CliffsI1.cmp 15KB
TropicaD1.cmp 15KB
SharpB1.cmp 15KB
VolcanoF1.cmp 15KB
SharpG1.cmp 15KB
CliffsE1.cmp 15KB
TropicaF1.cmp 15KB
TropicaC1.cmp 15KB
SharpC1.cmp 15KB
GlacierD1.cmp 15KB
GlacierC1.cmp 15KB
DesertD1.cmp 15KB
CliffsG1.cmp 15KB
CliffsA1.cmp 15KB
SharpD1.cmp 15KB
SharpF1.cmp 15KB
DesertG1.cmp 15KB
SnowD1.cmp 14KB
GlacierB1.cmp 14KB
VolcanoE1.cmp 14KB
ToxicB1.cmp 14KB
GlacierF1.cmp 14KB
SharpE1.cmp 14KB
DesertB1.cmp 14KB
CliffsH1.cmp 14KB
ToxicA1.cmp 14KB
StartingBase1.cmp 14KB
SharpH1.cmp 14KB
DesertF1.cmp 14KB
GlacierG1.cmp 14KB
VolcanoA1.cmp 14KB
TropicaI1.cmp 13KB
VolcanoD1.cmp 13KB
GlacierA1.cmp 13KB
SharpI1.cmp 13KB
ToxicD1.cmp 13KB
CliffsF1.cmp 13KB
CrystalDBase1.cmp 13KB
ToxicC1.cmp 13KB
FinalB1.cmp 13KB
ArcadeRingWorldABase.cmp 12KB
GauntletTrackBase.cmp 12KB
CrystalCBase1.cmp 12KB
DesertI1.cmp 12KB
SnowB1.cmp 12KB
VolcanoB1.cmp 11KB
SnowC1.cmp 11KB
CrystalABase1.cmp 11KB
CrystalBBase1.cmp 11KB
FinalA1.cmp 11KB
SnowA1.cmp 11KB
StartingBaseBuilding.cmp 11KB
FinalC1.cmp 10KB
GlacierE1.cmp 10KB
CrystalA1.cmp 10KB
TropicaABuild1.cmp 9KB
CrystalB1.cmp 9KB
共 1218 条
- 1
- 2
- 3
- 4
- 5
- 6
- 13
资源评论
快乐无限出发
- 粉丝: 1126
- 资源: 7260
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功