Exemplo n.º 1
0
TextureProgressBar* NodeFactory::CreateTextureProgressBar(ProgressType progressType, const FileIdRef& textureName, const FileIdRef& backgroundTextureName, float percent /*= 1.f*/)
{
	TextureProgressBar* val = CreateTextureProgressBar(progressType, textureName, percent);
	Sprite* sprite = CreateSprite(backgroundTextureName);
	sprite->SetDepth(-1);
	val->AddChild(sprite);
	return val;
}
Exemplo n.º 2
0
INode* SpriteReader::CreateNodeWithJson(INodeEditor& editor, const rapidjson::Value& nodeTree, const StringRef& className /*= StringRef::Empty*/, NodeCreateFlags flags /*= NodeCreateFlags::None*/)
{
	const rapidjson::Value& fileDataNode = nodeTree["FileData"];
	StringRef path = fileDataNode.GetMember("Path", nullptr);
	Sprite* sprite = CreateSprite(path);
	SetPropsWithJson(sprite, nodeTree);
	return sprite;
}
Exemplo n.º 3
0
		void declareSprites() {
			speed = CreateSprite("./images/upgrades/speed.png", 16, 16, false);
			maxHealth = CreateSprite("./images/upgrades/health.png", 16, 16, false);
			bulletSpeed = CreateSprite("./images/upgrades/bulletSpeed.png", 16, 16, false);
			damageResistance = CreateSprite("./images/upgrades/armor.png", 16, 16, false);
			maxRange = CreateSprite("./images/upgrades/range.png", 16, 16, false);
			sprintDuration = CreateSprite("./images/upgrades/sprintDuration.png", 16, 16, false);
			sprintCooldownSpeed = CreateSprite("./images/upgrades/sprintCooldownSpeed.png", 16, 16, false);
			fireRate = CreateSprite("./images/upgrades/fireRate.png", 16, 16, false);
		}
Exemplo n.º 4
0
u8 sub_814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5)
{
    int v9;
    struct Sprite *v10;

    if (gUnknown_0203A3D0 != 0x40 || gUnknown_0203A3D1 != 0x40)
        sub_814A7FC();

    v9 = 1;
    if (a2 == 0xFFFF)
    {
        gUnknown_0203A360[a3 & 0xF] = a4;
        if (LoadSpritePalette(&gUnknown_0842F240) != 0xFF)
        {
            a2 = 0xFFF0;
            v9 = 0;
        }
    }

    LoadSpriteSheetDeferred(&gUnknown_0842F140[a3 & 0xF]);
    gUnknown_0203A3D0 = CreateSprite(&gSpriteTemplate_842F250[v9], 0, 0xA0, a1);
    gUnknown_0203A3D1 = CreateSprite(&gSpriteTemplate_842F250[2], 0, 0xA0, a1);
    if (gUnknown_0203A3D0 != 0x40)
    {
        v10 = &gSprites[gUnknown_0203A3D0];
        if (a2 == 0xFFFF)
            v10->oam.paletteNum = 0;
        else
            v10->oam.paletteNum = IndexOfSpritePaletteTag(a2);
    }
    if (gUnknown_0203A3D1 != 0x40)
    {
        v10 = &gSprites[gUnknown_0203A3D1];
        if (a2 == 0xFFFF)
            v10->oam.paletteNum = 0;
        else
            v10->oam.paletteNum = IndexOfSpritePaletteTag(a2);

        if (!(REG_DISPCNT & (DISPCNT_WIN0_ON | DISPCNT_WIN1_ON)))
            *(u8 *)(REG_ADDR_WINOUT) |= 0x1F;
        gUnknown_0203A3D3 = REG_DISPCNT >> 0xF;
        gUnknown_0203A3D4 = *(u8 *)(REG_BASE + REG_OFFSET_WINOUT + 1);
        REG_DISPCNT |= DISPCNT_OBJWIN_ON;
        *(u8 *)(REG_ADDR_WINOUT + 1) = 0x10;
    }
Exemplo n.º 5
0
Cup::Cup(void)
{
	settings = FileSettings::Instance();
	spriteID = CreateSprite("./images/pong_cup_v1.png", settings->GetInt("CUP_W"), settings->GetInt("CUP_H"), true);
	cupPos = Vector2(settings->GetFloat("CUP1_POSX"), settings->GetFloat("CUP1_POSY"));
	rimPos = Vector2(settings->GetFloat("CUP1_POSX"), settings->GetFloat("CUP1_POSY") + settings->GetInt("CUP_H")/2);
	cupCollider = Rect(cupPos, settings->GetInt("CUP_W"), settings->GetInt("CUP_H"));
	rimCollider = Rect(rimPos, settings->GetInt("CUP_W"), 1);
}
HRESULT Reset(IDirect3DDevice9Ex* pDev9Ex)
{
    // reset the d3d9ex device
    HRESULT hr = pDev9Ex->Reset( &g_D3DPresentParameters);
    if(FAILED(hr))
        return hr;

    return CreateSprite();
}
Exemplo n.º 7
0
void InitPlayer( )
{
    char* sheet = "./content/img/player/a1.png";    
    
    LPlayer.BaseGround = 672;
    LPlayer.X = 256;
    LPlayer.Y = 672;
    LGame.Sprites.push_back( CreateSprite( 256, 672, 64, 64, sheet, TT_PLAYER ) );
}
Exemplo n.º 8
0
// Initializes frames //
void Player::InitAnim() {
	shipMove[0] = CreateSprite("./images/Ship_Idle.png", 64, 64, true);
	shipMove[1] = CreateSprite("./images/Ship_Left.png", 64, 64, true);
	shipMove[2] = CreateSprite("./images/Ship_Right.png", 64, 64, true);
	
	exhaust[0] = CreateSprite("./images/Flame01.png", 64, 64, true);
	exhaust[1] = CreateSprite("./images/Flame02.png", 64, 64, true);
	exhaust[2] = CreateSprite("./images/Flame03.png", 64, 64, true);
	exhaust[3] = CreateSprite("./images/Flame04.png", 64, 64, true);
	exhaust[4] = CreateSprite("./images/Flame05.png", 64, 64, true);
}
Exemplo n.º 9
0
int LuaCreateAnimation(lua_State* _State) {
	struct Sprite* _Sprite = NULL;
	const char* _File = luaL_checkstring(_State, 1);\
	struct Resource* _Resource = ResourceGet(_File);
	SDL_Point _Pos = {0, 0};

	_Sprite = CreateSprite(ResourceGetData(_Resource), 0, &_Pos);
	LuaCtor(_State, _Sprite, LOBJ_SPRITE);
	return 1;
}
Exemplo n.º 10
0
//================================================
//テクスチャ読み込み
//================================================
void CChara::LoadImage(char *name, int ColorKey)
{
	Tex = LunaTexture::CreateFromFile(name, FORMAT_TEXTURE_2D, ColorKey);
	
	CreateSprite();
	
	chargefx.LoadImageA("system\\charge.bmp", COLORKEY_WHITE);
	
	mchargefx.LoadImageA("system\\charge2.bmp", COLORKEY_WHITE);
}
Exemplo n.º 11
0
void Weapon::InitializeBullet(float a_x, float a_y, int dir)
{
	x = a_x;
	y = a_y;
	height = 8.f;
	width = 8.f;
	velocity = 250.f;
	spriteID = CreateSprite("./images/rock.png", width, height, true);
	direction = dir;
	isActive = true;
}
Exemplo n.º 12
0
Player::Player(void) {
	InitAnim();
	bulletSize = 24;
	width = 0;
	height = 0;
	x = 0;
	y = 0;
	sprite = CreateSprite( "./images/Ship_Idle.png", 64, 64, true);
	collision = true;
	state = 0;
}
Exemplo n.º 13
0
void InitBackground( )
{
    char* background = "./content/img/background/a1.png";
    char* trees = "./content/img/background/a2.png";
    char* bigtree = "./content/img/background/a3.png";
    
    LGame.Sprites.push_back( CreateSprite( 0, 0, LGame.ScreenWidth, LGame.ScreenHeight, background, TT_BACKGROUND ) );

    Vector2 startingLocation;
    startingLocation.X = 0;
    startingLocation.Y = 482;
    for( int i = 0; i < 7; i++ )
    {
        LGame.Sprites.push_back( CreateSprite( int( startingLocation.X ), int( startingLocation.Y ), 160, 224, trees, TT_BACKGROUND  ) );
        startingLocation.X += 160;
    }

    LGame.Sprites.push_back( CreateSprite( 0, 396, LGame.ScreenWidth, LGame.ScreenHeight / 2, bigtree, TT_GROUND ) );
    LGame.Sprites.push_back( CreateSprite( LGame.ScreenWidth, 396, LGame.ScreenWidth, LGame.ScreenHeight / 2, bigtree, TT_GROUND ) );
}
Exemplo n.º 14
0
Cup::Cup(CupInitialiser ci_)
{
	settings = FileSettings::Instance();
	spriteID = CreateSprite("./images/pong_cup_v1.png", ci_.width, ci_.height, true);
	cupPos = ci_.pos;
	rimPos = Vector2(cupPos.x, cupPos.y + ci_.height/2);
	cupCollider = Rect(cupPos, ci_.width, ci_.height);
	
	//rim collider 1 pixel high, full width of the cup
	rimCollider = Rect(rimPos, ci_.width, 1);
	victim = ci_.victim;
}
Exemplo n.º 15
0
Sprite_Battler::Sprite_Battler(Game_Battler* battler) :
	battler(battler),
	anim_state(AnimationState_Idle),
	cycle(0),
	sprite_file(""),
	sprite_frame(-1),
	fade_out(255),
	flash_counter(0),
	old_hidden(false),
	idling(true) {

	CreateSprite();
}
Exemplo n.º 16
0
// Update
void Spriteset_Map::Update() {
	Tone new_tone = Main_Data::game_screen->GetTone();

	tilemap->SetOx(Game_Map::GetDisplayX() / (SCREEN_TILE_SIZE / TILE_SIZE));
	tilemap->SetOy(Game_Map::GetDisplayY() / (SCREEN_TILE_SIZE / TILE_SIZE));
	tilemap->SetTone(new_tone);
	tilemap->Update();

	for (size_t i = 0; i < character_sprites.size(); i++) {
		character_sprites[i]->Update();
		character_sprites[i]->SetTone(new_tone);
	}

	std::string name = Game_Map::Parallax::GetName();
	if (name != panorama_name) {
		panorama_name = name;
		if (name.empty()) {
			panorama->SetBitmap(BitmapRef());
			tilemap->SetFastBlitDown(true);
		} else {
			FileRequestAsync *request = AsyncHandler::RequestFile("Panorama", panorama_name);
			request->SetGraphicFile(true);
			panorama_request_id = request->Bind(&Spriteset_Map::OnPanoramaSpriteReady, this);
			request->Start();
		}
	}
	panorama->SetOx(Game_Map::Parallax::GetX());
	panorama->SetOy(Game_Map::Parallax::GetY());
	panorama->SetTone(new_tone);

	Game_Vehicle* vehicle;
	int map_id = Game_Map::GetMapId();
	for (int i = 1; i <= 3; ++i) {
		vehicle = Game_Map::GetVehicle((Game_Vehicle::Type) i);

		if (!vehicle_loaded[i - 1] && vehicle->GetMapId() == map_id) {
			vehicle_loaded[i - 1] = true;
			CreateSprite(vehicle, need_x_clone, need_y_clone);
		}
	}

	for (auto& shadow : airship_shadows) {
		shadow->SetTone(new_tone);
		shadow->Update();
	}

	timer1->Update();
	timer2->Update();

	weather->SetTone(new_tone);
}
Exemplo n.º 17
0
int LuaCreateSprite(lua_State* _State) {
	struct Sprite* _Sprite = NULL;
	const char* _File = luaL_checkstring(_State, 1);
	struct Resource* _Resource = ResourceGet(_File);
	SDL_Point _Pos = {0, 0};

	if(_Resource == NULL) {
		lua_pushnil(_State);
		return 1;
	}
	_Sprite = CreateSprite(_Resource, 0, &_Pos);
	LuaCtor(_State, _Sprite, LOBJ_SPRITE);
	return 1;
}
Exemplo n.º 18
0
void WallyHandleTrainerSlide(void)
{
    LoadPlayerTrainerBankSprite(2, gActiveBattler);
    GetMonSpriteTemplate_803C5A0(2, GetBattlerPosition(gActiveBattler));
    gBankSpriteIds[gActiveBattler] = CreateSprite(
      &gUnknown_02024E8C,
      80, 80 + 4 * (8 - gTrainerBackPicCoords[2].coords),
      30);
    gSprites[gBankSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
    gSprites[gBankSpriteIds[gActiveBattler]].pos2.x = -96;
    gSprites[gBankSpriteIds[gActiveBattler]].data[0] = 2;
    gSprites[gBankSpriteIds[gActiveBattler]].callback = sub_80313A0;
    gBattleBankFunc[gActiveBattler] = sub_8137908;
}
Exemplo n.º 19
0
static void sub_80DD774(struct Task *task)
{
    const struct SpriteTemplate *spriteTemplate;
    int var0;
    u16 x, y;
    u8 spriteId;

    switch (task->data[1])
    {
    case 1:
        spriteTemplate = &gSpriteTemplate_83DAD78;
        var0 = 0;
        break;
    case 2:
    case 3:
        spriteTemplate = &gSpriteTemplate_83DAD90;
        var0 = 80;
        break;
    case 4:
        spriteTemplate = &gSpriteTemplate_83DAD90;
        var0 = 64;
        break;
    case 5:
        spriteTemplate = &gSpriteTemplate_83DAD90;
        var0 = 48;
        break;
    default:
        return;
    }

    x = task->data[2] >> 3;
    y = task->data[3] >> 3;
    x += (task->data[12] * 4);

    spriteId = CreateSprite(spriteTemplate, x, y, 35);
    if (spriteId != 64)
    {
        gSprites[spriteId].data[0] = 18;
        gSprites[spriteId].data[2] = ((task->data[12] * 20) + x) + (task->data[1] * 3);
        gSprites[spriteId].data[4] = y;
        gSprites[spriteId].data[5] = -16 - (task->data[1] * 2);
        gSprites[spriteId].oam.tileNum += var0;

        InitAnimArcTranslation(&gSprites[spriteId]);
        task->data[11]++;
    }

    task->data[12] *= -1;
}
Exemplo n.º 20
0
void sub_80C5CD4(struct PCScreenEffectStruct *unkStruct)
{
    u16 i;

    struct SpriteSheet sprSheet = { gUnknownGfx_083D190C, sizeof(gUnknownGfx_083D190C), 0 };
    struct SpritePalette sprPalette = { gUnknownPal_083D18EC, 0 };
    struct SpriteTemplate sprTemplate =
        {
            0,
            0,
            &gOamData_83D18D8,
            gSpriteAnimTable_83D18E8,
            NULL,
            gDummySpriteAffineAnimTable,
            sub_80C60CC,
        };

    sprSheet.tag = unkStruct->tileTag;
    sprTemplate.tileTag =  unkStruct->tileTag;
    sprPalette.tag = unkStruct->paletteTag;
    sprTemplate.paletteTag = unkStruct->paletteTag;

    LoadSpriteSheet(&sprSheet);
    LoadSpritePalette(&sprPalette);

    unkStruct->unk0C = 1;
    unkStruct->unk0A = 0;
    unkStruct->unk08 = 0;
    unkStruct->selectedPalettes  = ~(0x10000 << IndexOfSpritePaletteTag(unkStruct->paletteTag)) & 0xFFFF0000;

    if (unkStruct->unk04 == 0)
        unkStruct->unk04 = 16;

    if (unkStruct->unk06 == 0)
        unkStruct->unk06 = 20;

    gUnknown_020387EC = unkStruct;

    for (i = 0; i < 8; i++)
    {
        u8 spriteId = CreateSprite(&sprTemplate, 32 * i + 8, 80, 0);
        if (spriteId == MAX_SPRITES)
            break;
        gSprites[spriteId].data[0] = (i < 4) ? -unkStruct->unk04 : unkStruct->unk04;
    }

    REG_BLDCNT = 191;
    REG_BLDY = 16;
}
Exemplo n.º 21
0
 Sprite* PixelMapPartial::spriteForDescriptor(komorki::PixelDescriptor* pixelD)
 {
   if (pixelD->m_type == komorki::PixelDescriptor::Empty)
   {
     return nullptr;
   }
   
   cocos2d::Rect r = OffsetForType(pixelD);
   auto s = CreateSprite();
   s->setTextureRect(r);
   s->setScale(kSpriteScale);
   s->setTag(TagForType(pixelD));
   
   return s;
 }
Exemplo n.º 22
0
unsigned Assets::LoadSprite(char *path, int w, int h, eSpriteFlag s, bool center)
{
	if (nSprites < 64)
	{
		// Put the sprite ID on the Heap
		unsigned *t = new unsigned(CreateSprite(path, w, h, center));

		sprites[nSprites++] = t;  
		if (s != eNone)	
			assoc[s] = t; // store sprties	

		return *t;  //The sprites are rturned
	}
	return 0;
}
Exemplo n.º 23
0
void initTitle()
{
	titlem = CreateSprite( "./images/start.png", SCREEN_X, SCREEN_Y, true );
	MoveSprite(titlem, SCREEN_X>>1, SCREEN_Y>>1);
	titlepaddle.sprite = CreateSprite( "./images/plyr.png", titlepaddle.width, titlepaddle.height, true);
	titlewall.sprite = CreateSprite( "./images/plyr.png", titlewall.width, titlewall.height, true );
	titleball.sprite = CreateSprite( "./images/b.png", BALL_W, BALL_H, true );
	cursor.sprite = CreateSprite( "./images/cursor.png", cursor.width, cursor.height, true );
	help.sprite = CreateSprite( "./images/help.png", 600, 360, true);
}
Exemplo n.º 24
0
void CreateEnemies(){
	float enemyX = iScreenWidth * .2f;
	float enemyY = iScreenHeight * .7f;

	for (int i = 0; i < 18; ++i)
	{
		Aliens[i].SetMoveExtremes(32.f, 625.f);
		Aliens[i].SetPosition(enemyX, enemyY);
		Aliens[i].spriteId = CreateSprite("./images/invaders/invaders_1_00.png", 40, 32, true);
		MoveSprite(Aliens[i].spriteId, enemyX, enemyY);
		enemyX += .12f* iScreenWidth;
		if (enemyX > iScreenWidth * .8f){
			enemyX = iScreenWidth * .2f;
			enemyY -= iScreenHeight * .08f;
		}
	}
}
Exemplo n.º 25
0
//////////////////////////////////////////////////////////////////////////
// Basic Sprite creation and manipulation functionality
//////////////////////////////////////////////////////////////////////////
PyObject* AIE_CreateSprite(PyObject *self, PyObject *args)
{
	const char* pTextureName; float fv2Size[2]; float fv2Origin[2]; float fv4UVCoords[4]; unsigned int vColour[4];
	if (!PyArg_ParseTuple(args, "sffffffffiiii", &pTextureName, 
												 &fv2Size[0], &fv2Size[1], 
												 &fv2Origin[0], &fv2Origin[1], 
												 &fv4UVCoords[0], &fv4UVCoords[1], &fv4UVCoords[2], &fv4UVCoords[3],
												 &vColour[0], &vColour[1], &vColour[2], &vColour[3]) ) 
	{
		ParsePyTupleError( __func__, __LINE__ );
		return nullptr;
	}
	//fv4UVCoords[0] = 0.f, fv4UVCoords[1] = 0.f, fv4UVCoords[2] = 1.f, fv4UVCoords[3] = 1.f;
	unsigned int uiSpriteID = CreateSprite( pTextureName, fv2Size, fv2Origin, fv4UVCoords, SColour(vColour[0], vColour[1], vColour[2], vColour[3]));
	//unsigned int uiSpriteID = CreateSprite( pTextureName, fv2Size[0], fv2Size[1], false );
	return Py_BuildValue("i", uiSpriteID);
}
Exemplo n.º 26
0
CResourceManager::CResourceManager()
{
    // Default spriteSheets
    SpriteSheetMap["Default"] = std::make_shared<CSpriteSheet>("./resources/gfx/default.png");
    SpriteSheetMap["Tileset"] = std::make_shared<CSpriteSheet>("./resources/gfx/tileset.png");

    //==

    // Default DefaultSprites

    CreateSprite("DefaultSprite", "Null", 15 * 16, 15 * 16, 16, 16, SpriteSheetMap.at("Default"));

    // Default ItemSprites

    CreateSprite("ItemSprite", "Helm", 0 * 16, 0 * 16, 16, 16, SpriteSheetMap.at("Default"));
    CreateSprite("ItemSprite", "Apple", 10 * 16, 0 * 16, 16, 16, SpriteSheetMap.at("Default"));

    // Default TileSprites

    CreateSprite("TileSprite", "Dirt", 2 * 16, 0 * 16, 16, 16, SpriteSheetMap.at("Tileset"));
    CreateSprite("TileSprite", "Cobblestone", 0 * 16, 1 * 16, 16, 16, SpriteSheetMap.at("Tileset"));
    CreateSprite("TileSprite", "Tree", 5 * 16, 3 * 16, 16, 16, SpriteSheetMap.at("Tileset"));

    // In the future the animation offsets will be loaded from files
    std::vector<SDL_Rect> Offsets;

    // Wheat looping
    for(int x = 8; x <= 14; x++)
        Offsets.push_back({x * 16, 5 * 16, 16, 16});

    AnimationMap["TestAnimation"]["Wheat"] = std::make_shared<CAnimation>(SpriteSheetMap.at("Tileset"), Offsets);

    Offsets.clear();

    // Wool looping
    for(int x = 0; x <= 15; x++)
        Offsets.push_back({x * 16, 4 * 16, 16, 16});

    AnimationMap["TestAnimation"]["Wool"] = std::make_shared<CAnimation>(SpriteSheetMap.at("Tileset"), Offsets);

    Offsets.clear();

    // All tiles
    for(int y = 0; y < 16; y++)
        for(int x = 0; x < 16; x++)
            Offsets.push_back({16 * x, 16 * y, 16, 16});

    AnimationMap["TestAnimation"]["All"] = std::make_shared<CAnimation>(SpriteSheetMap.at("Tileset"), Offsets);

    Offsets.clear();

}
Exemplo n.º 27
0
Enemy::Enemy(const char* a_TextureName, int a_Sprite_W, int a_Sprite_H, float a_Position_X, float a_Position_Y, float a_Velocity_X, float a_Velocity_Y, int a_Health, float& PlayerScore)
{
	score = &PlayerScore;
	time = 0;
	Init(a_TextureName, a_Sprite_W,  a_Sprite_H, a_Position_X, a_Position_Y);
	m_SpriteID = CreateSprite( m_TextureName, m_Sprite_W, m_Sprite_H, true );
	m_EnemyHealth = a_Health;
	IsAlive = true;
	m_SpriteType = 'E';
	m_Velocity = Vector2D(a_Velocity_X, a_Velocity_Y);
	//Vector2D tempPosition(200,300);
	m_Collider.SetRadius(16.0f);
	for( i=0; i < 40; i++)
	{
		Bullet* EnemyBullet = new Bullet("./images/RedLazerPaperClip16x64.png",8,32, -10, -10, 0, 0,'E',1);
		EBullets.push_back(EnemyBullet);
	}
}
Exemplo n.º 28
0
void CreateEnemies() {
	float fEnemyX = iScreenWidth * 0.2f;// prepare start variables	
	float fEnemyY = iScreenHeight * 0.7f;

	for (int i = 0; i < enemyArr1Length; i++) {// double loops to get to the multiple arrays
		for (int j = 0; j < enemyArr2Length; j++) {
			alienShips[i][j].iSpriteID = CreateSprite("./images/invaders/invaders_1_00.png", 64, 62, true);//create
			alienShips[i][j].x = fEnemyX;// set the x and y values in their proper place based on the screen and sprite sizes
			alienShips[i][j].y = fEnemyY;
			MoveSprite(alienShips[i][j].iSpriteID, alienShips[i][j].x, alienShips[i][j].y);//put in positions
			fEnemyX += 0.12f * iScreenWidth; //change position for next iteration
		}
		fEnemyY -= 0.1f * iScreenHeight;//change height
		fEnemyX = iScreenWidth * 0.2f;//reset x value
	}

	enemyDirection = eRIGHT;
}
Exemplo n.º 29
0
Hero::Hero(const char* a_TextureName, int a_Sprite_W, int a_Sprite_H, float a_Position_X, float a_Position_Y, float a_Velocity_X, float a_Velocity_Y, int a_Health)
{

	Init(a_TextureName, a_Sprite_W,  a_Sprite_H, a_Position_X, a_Position_Y);
	m_SpriteID = CreateSprite( m_TextureName, m_Sprite_W, m_Sprite_H, true );
	m_HeroHealth = a_Health;
	IsAlive = true;
	m_SpriteType = 'H';
	Vector2D Velocity (a_Velocity_X, a_Velocity_Y);
	//HeroBullet = Bullet("./images/Bullet.png",4, 4, 10, 10, 0, 0,'H');
	Vector2D tempPosition(200,300);
	//HeroBullet.SetPosition(tempPosition);
	//std::list<Bullet>HeroBullets(20, Bullet("./images/Bullet.png",4, 4, 10, 10, 0, 0,'H'));
	for( i=0; i < 20; i++)
	{
		Bullet HeroBullet("./images/Bullet.png",4, 4, 10, 10, 0, 0,'H');
		HBullets.push_back(HeroBullet);
	}
}
Exemplo n.º 30
0
//Initialize the game
GAME_DLL GAME_INIT(Game_Init)
{
	GLenum error = glGetError();
	SetTexture(&test.MeshTexture, "resources\\textures\\tile2.png");
	error = glGetError();
	//the mesh i will use
	CreateSprite(&test, vec2(50, 50), vec3(0, 0, 0), &test.MeshTexture, &Color(1, 1, 1, 1), 1);
	error = glGetError();
	//Use older shaders with old GLSL
#if GLSL_VERSION == ANCIENT_VERSION
	shader = Shader("resources\\shaders\\vertex shader 120.vert", "resources\\shaders\\fragment shader 120.frag");
	error = glGetError();
#elif GLSL_VERSION == MODERN_VERSION	//Use modern shaders with modern GLSL
	shader = Shader("resources\\shaders\\vertex shader.vert", "resources\\shaders\\fragment shader.frag");
#endif

	//CalculatePerspectiveProjection(&Cam, 80.0f, screenWidth, screenHeight, -0.1f, 500.0f);
	CalculateOrthoProjectionMatrix(&Cam, screenWidth, screenHeight, -0.1f, 500.0f);
}