• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetY函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetY函数的典型用法代码示例。如果您正苦于以下问题:C++ GetY函数的具体用法?C++ GetY怎么用?C++ GetY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetY函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: FxHomeCallTimer

func FxHomeCallTimer(object target, proplist fx, int time)
{
	if(!master)
	{
		KillBall();
		return -1;
	}	
	
	if(GetEffect("Blocked", this))
	{
		ox=GetX();
		oy=GetY();
		return;
	}
	
	DrawParticleLine("Flash", 0, 0, ox-GetX(), oy-GetY(), 1, 0, 0, 15, hometrailparticles);
	
	if(time%7 == 0)
	{
		for(var i = 0; i < 360; i+=5)
		{
			CreateParticle("Flash", Sin(i, 3), -Cos(i, 5), 0, 0, 10, hometrailparticles2, 2);
		}
	}

	fx.x = master->GetX();
	fx.y = master->GetY();
	var angle = Angle(GetX(), GetY(), fx.x, fx.y, 10);
	var txdir = Sin(angle, Speed + 12, 10);
	var tydir = -Cos(angle, Speed + 12, 10);
	SetXDir((GetXDir() + (txdir - GetXDir())/2));
	SetYDir((GetYDir() + (tydir - GetYDir())/2));
	
	CheckForEnemies(HomeCallSize);
	
	ox=GetX();
	oy=GetY();
	
	var dst = Distance(GetX(), GetY(), fx.x, fx.y);
	if(dst < 8)
	{
		AddShield(master);
		Sound("Ball::ball_shield", false, 20);
		
		var particles =
		{
			Prototype = Particles_Glimmer(),
			R = pR,
			G = pG,
			B = pB,
			Alpha = 255,
			Size = PV_Linear(10, 0),
			OnCollision = PC_Bounce(),
		};
		CreateParticle("StarSpark", 0, 0, PV_Random(-60,60), PV_Random(-60, 60), 25, particles, 5);
		
		var particle =
		{
			Alpha = PV_Linear(255, 0),
			Size = 50,
			R = pR,
			G = pG,
			B = pB,
			BlitMode = GFX_BLIT_Additive,
		};
		master->CreateParticle("StarSpark", 0, 0, 0, 0, 7, particle, 4);
		
		FollowMaster();
		return -1;
	}
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:71,代码来源:Script.c


示例2: GetRight

Line Rectangle::GetRight() const {
    auto p = this->_transform.GetPosition();
    auto e = this->_half_extents;
    return {{p.GetX() + e.GetX(), p.GetY() - e.GetY()}, {p.GetX() + e.GetX(), p.GetY() + e.GetY()}};
}
开发者ID:cugone,项目名称:Abrams2015,代码行数:5,代码来源:CRectangle.cpp


示例3: GetBottomRight

Vector2D Rectangle::GetBottomRight() const {
    auto p = this->_transform.GetPosition();
    auto e = this->_half_extents;
    return {p.GetX() + e.GetX(), p.GetY() + e.GetY()};
}
开发者ID:cugone,项目名称:Abrams2015,代码行数:5,代码来源:CRectangle.cpp


示例4: wxLogInfo

void BackgroundDrawer::DrawYAxisVals(wxDC *dc, int tick_len, int line_width) {
	double min = m_draw->GetDrawInfo()->GetMin();
	double max = m_draw->GetDrawInfo()->GetMax();
	double dif = max - min;

	if (dif <= 0) {
		wxLogInfo(_T("%s %f %f"), m_draw->GetDrawInfo()->GetName().c_str(), min, max);
		assert(false);
	}

	//procedure for calculating distance between marks stolen from SzarpDraw2
	double x = dif;
	double step;
	int i = 0;

	if (x < 1)
		for (;x < 1; x *=10, --i);
	else
		for (;(int)x / 10; x /=10, ++i);

	if (x <= 1.5)
		step = .1;
	else if (x <= 3.)
		step = .2;
	else if (x <= 7.5)
		step = .5;
	else
		step = 1.;

	double acc = 1;

	int prec = m_draw->GetDrawInfo()->GetPrec();
				

	for (int p = prec; p > 0; --p)
		acc /= 10;

	double factor  = (i > 0) ? 10 : .1;

	for (;i; i -= i / abs(i))
		step *= factor;

	if (step < acc)
		step = acc;

    	dc->SetPen(wxPen(GetTimeAxisCol(), line_width, wxSOLID));

	int w, h;
	GetSize(&w, &h);

	h -= m_bottommargin + m_topmargin;

	for (double val = max; (min - val) < acc; val -= step) {
	//for (double val = min; (val - max) < acc; val += step) {

		int y = GetY(val);

		dc->DrawLine(m_leftmargin - tick_len, y, m_leftmargin, y);

		wxString sval = m_draw->GetDrawInfo()->GetValueStr(val, _T("- -"));
		int textw, texth;
		dc->GetTextExtent(sval, &textw, &texth);
		dc->DrawText(sval, m_leftmargin - textw - 1, y + line_width / 2 + 1 );
	}

	dc->SetPen(wxNullPen);

}
开发者ID:cyclefusion,项目名称:szarp,代码行数:68,代码来源:drawview.cpp


示例5: SetPosition

void Triangle::SetX(double x) {
    SetPosition(x, GetY());
}
开发者ID:cugone,项目名称:Abrams2010,代码行数:3,代码来源:CTriangle.cpp


示例6: return

bool Game_Character::IsInPosition(int x, int y) const {
	return ((GetX() == x) && (GetY() == y));
}
开发者ID:KitoHo,项目名称:Player,代码行数:3,代码来源:game_character.cpp


示例7: DrawBaseBuilding

void nobHarborBuilding::Draw(int x, int y)
{
    // Gebäude an sich zeichnen
    DrawBaseBuilding(x, y);

    // Hafenfeuer zeichnen // TODO auch für nicht-römer machen
    if (nation == NAT_ROMANS || nation == NAT_JAPANESE || nation == NAT_BABYLONIANS)
    {
        LOADER.GetNationImage(nation, 500 + 5 * GAMECLIENT.GetGlobalAnimation(8, 2, 1, GetObjId() + GetX() + GetY()))->Draw(x + FIRE_POS[nation].x, y + FIRE_POS[nation].y, 0, 0, 0, 0, 0, 0);
    }
    else if (nation == NAT_AFRICANS || nation == NAT_VIKINGS)
    {
        LOADER.GetMapPlayerImage(740 + GAMECLIENT.GetGlobalAnimation(8, 5, 2, GetObjId() + GetX() + GetY()))->Draw(x + FIRE_POS[nation].x, y + FIRE_POS[nation].y);
    }

    if (nation == NAT_ROMANS)
    {
        // Zusätzliches Feuer
        LOADER.GetMapPlayerImage(740 + GAMECLIENT.GetGlobalAnimation(8, 5, 2, GetObjId() + GetX() + GetY()))->Draw(x + EXTRAFIRE_POS[nation].x, y + EXTRAFIRE_POS[nation].y);
    }

    // Läuft gerade eine Expedition?
    if(expedition.active)
    {
        // Waren für die Expedition zeichnen

        // Bretter
        for(unsigned char i = 0; i < expedition.boards; ++i)
            LOADER.GetMapImageN(2200 + GD_BOARDS)->Draw(x + BOARDS_POS[nation].x - 5, y + BOARDS_POS[nation].y - i * 4, 0, 0, 0, 0, 0, 0);
        // Steine
        for(unsigned char i = 0; i < expedition.stones; ++i)
            LOADER.GetMapImageN(2200 + GD_STONES)->Draw(x + STONES_POS[nation].x + 8, y + STONES_POS[nation].y - i * 4, 0, 0, 0, 0, 0, 0);

        // Und den Bauarbeiter, falls er schon da ist
        if(expedition.builder)
        {
            unsigned id = GAMECLIENT.GetGlobalAnimation(1000, 7, 1, GetX() + GetY());

            const int WALKING_DISTANCE = 30;

            // Wegstrecke, die er von einem Punkt vom anderen schon gelaufen ist
            int walking_distance = (id % 500) * WALKING_DISTANCE / 500;
            // Id vom laufen
            unsigned walking_id = (id / 32) % 8;

            int right_point = x - 20 + BUILDER_POS[nation].x;

            if(id < 500)
            {
                LOADER.bob_jobs_cache[nation][JOB_BUILDER][0][walking_id].draw(right_point - walking_distance, y + BUILDER_POS[nation].y, COLOR_WHITE, COLORS[gwg->GetPlayer(player).color]);
//              LOADER.GetBobN("jobs")->Draw(23,0,false,walking_id,right_point-walking_distance,
//                  y+BUILDER_POS[nation].y,COLORS[gwg->GetPlayer(player).color]);
                //DrawShadow(right_point-walking_distance,y,walking_id,0);
            }
            else
            {
                LOADER.bob_jobs_cache[nation][JOB_BUILDER][3][walking_id].draw(right_point - WALKING_DISTANCE + walking_distance, y + BUILDER_POS[nation].y, COLOR_WHITE, COLORS[gwg->GetPlayer(player).color]);
//              LOADER.GetBobN("jobs")->Draw(23,3,false,walking_id,
//                  right_point-WALKING_DISTANCE+walking_distance,y+BUILDER_POS[nation].y,
//                  COLORS[gwg->GetPlayer(player).color]);
                //DrawShadow(right_point-WALKING_DISTANCE+walking_distance,y,walking_id,0);
            }
        }

    }
}
开发者ID:polemon,项目名称:s25client,代码行数:66,代码来源:nobHarborBuilding.cpp


示例8: SuggestMove

void ribi::con3::ConnectThreeWidget::DoComputerMove() noexcept
{
  const auto move = SuggestMove();
  assert(CanDoMove(move->GetX(),move->GetY()));
  DoMove(move->GetX(),move->GetY());
}
开发者ID:RLED,项目名称:ProjectRichelBilderbeek,代码行数:6,代码来源:connectthreewidget.cpp


示例9: RenderObject

void RenderManager::RenderObject(const Shape& shape, bool filled, ALLEGRO_BITMAP* texture) {
    //shape->Render(al_get_backbuffer(_display_context));
    auto& verts = shape.GetVerticies();
    std::vector<ALLEGRO_VERTEX> allegro_verts;
	allegro_verts.reserve(verts.size());
    for(const auto& v : verts) {
        auto p = a2de::Math::ToScreenScale(v.GetPosition());
        auto uv = v.GetUV();
        auto c = v.GetColor();
        allegro_verts.push_back(
                        std::move(ALLEGRO_VERTEX{
                            static_cast<float>(p.GetX()),
                            static_cast<float>(p.GetY()),
                            static_cast<float>(p.GetZ()),
                            static_cast<float>(uv.GetX()),
                            static_cast<float>(uv.GetY()),
                            c
                        }));
    }
    switch(shape.GetShapeType()) {
        case Shape::ShapeType::Point: {
            al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_POINT_LIST);
            break;
        } case Shape::ShapeType::Line: {
            al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_LINE_LIST);
            break;
        } case Shape::ShapeType::Rectangle: {
            filled ?
                al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_TRIANGLE_LIST)
                :
                al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_LINE_LOOP);
            break;
        } case Shape::ShapeType::Circle: {
            filled ?
                al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_TRIANGLE_FAN)
                :
                al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_POINT_LIST);
            break;
        } case Shape::ShapeType::Ellipse: {
            filled ?
                al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_TRIANGLE_FAN)
                :
                al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_POINT_LIST);
            break;
        } case Shape::ShapeType::Triangle: {
            filled ?
                al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_TRIANGLE_LIST)
                :
                al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_LINE_LOOP);
            break;
        } case Shape::ShapeType::Arc: {
            al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_LINE_STRIP);
            break;
        } case Shape::ShapeType::Polygon: {
            filled ?
                al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_TRIANGLE_FAN)
                :
                al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_LINE_LOOP);
            break;
        } case Shape::ShapeType::Spline: {
            al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_LINE_STRIP);
            break;
        } case Shape::ShapeType::Sector: {
            filled ?
                al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_TRIANGLE_FAN)
                :
                al_draw_prim(allegro_verts.data(), nullptr, texture, 0, allegro_verts.size(), ALLEGRO_PRIM_LINE_LOOP);
            break;
        } default: {
            /* DO NOTHING: All cases handled */;
        }
    }
}
开发者ID:cugone,项目名称:Abrams2015,代码行数:73,代码来源:CRenderManager.cpp


示例10: DrawBaseBuilding

/**
 *
 *
 *  @author OLiver
 */
void nobUsual::Draw(int x, int y)
{
    // Gebäude an sich zeichnen
    DrawBaseBuilding(x, y);

    // Wenn Produktion gestoppos ist, Schild außen am Gebäude zeichnen zeichnen
    if(disable_production_virtual)
        LOADER.GetMapImageN(46)->Draw(x + BUILDING_SIGN_CONSTS[nation][type].x, y + BUILDING_SIGN_CONSTS[nation][type].y, 0, 0, 0, 0, 0, 0);

    // Rauch zeichnen

    // Raucht dieses Gebäude und ist es in Betrieb? (nur arbeitende Gebäude rauchen schließlich)
    if(BUILDING_SMOKE_CONSTS[nation][type - 10].type && is_working)
    {
        // Dann Qualm zeichnen (damit Qualm nicht synchron ist, x- und y- Koordinate als Unterscheidung
        LOADER.GetMapImageN(692 + BUILDING_SMOKE_CONSTS[nation][type - 10].type * 8 + GAMECLIENT.GetGlobalAnimation(8, 5, 2, (GetX() + GetY()) * 100))
        ->Draw(x + BUILDING_SMOKE_CONSTS[nation][type - 10].x, y + BUILDING_SMOKE_CONSTS[nation][type - 10].y, 0, 0, 0, 0, 0, 0, 0x99EEEEEE);
    }

    // TODO: zusätzliche Dinge wie Mühlenräder, Schweinchen etc bei bestimmten Gebäuden zeichnen

    // Bei Mühle, wenn sie nicht arbeitet, immer Mühlenräder (nichtdrehend) zeichnen
    if(type == BLD_MILL && !is_working)
    {
        // Flügel der Mühle
        LOADER.GetNationImageN(nation, 250 + 5 * 49)->Draw(x, y, 0, 0, 0, 0, 0, 0);
        // Schatten der Flügel
        LOADER.GetNationImageN(nation, 250 + 5 * 49 + 1)->Draw(x, y, 0, 0, 0, 0, 0, 0, COLOR_SHADOW);
    }
    // Esel in den Kammer bei Eselzucht zeichnen
    else if(type == BLD_DONKEYBREEDER)
    {
        // Für alle Völker jeweils
        // X-Position der Esel
        const int DONKEY_X[NAT_COUNT][3] = {{13, 26, 39}, {3, 16, 30}, {2, 15, 29}, {7, 18, 30}, {3, 16, 30}};
        // Y-Position
        const int DONKEY_Y[NAT_COUNT] = { -9, -17, -21, -17, -22};
        // Animations-IDS des Esels
        const unsigned char DONKEY_ANIMATION[] =
        { 0, 1, 2, 3, 4, 5, 6, 7, 7, 7, 6, 5, 4, 4, 5, 6, 5, 7, 6, 5, 4, 3, 2, 1, 0 };

        // Die drei Esel zeichnen mithilfe von Globalanimation
        // Anzahl hängt von Produktivität der Eselzucht ab:
        // 0-29 - kein Esel
        // 30-60 - 1 Esel
        // 60-90 - 2 Esel
        // 90-100 - 3 Esel
        if(productivity >= 30) LOADER.GetMapImageN(2180 + DONKEY_ANIMATION[GAMECLIENT.GetGlobalAnimation(sizeof(DONKEY_ANIMATION), 5, 2, GetX() * (player + 2))])->Draw(x + DONKEY_X[nation][0], y + DONKEY_Y[nation]);
        if(productivity >= 60) LOADER.GetMapImageN(2180 + DONKEY_ANIMATION[GAMECLIENT.GetGlobalAnimation(sizeof(DONKEY_ANIMATION), 5, 2, GetY())])->Draw(x + DONKEY_X[nation][1], y + DONKEY_Y[nation]);
        if(productivity >= 90) LOADER.GetMapImageN(2180 + DONKEY_ANIMATION[GAMECLIENT.GetGlobalAnimation(sizeof(DONKEY_ANIMATION), 5, 2, GetX() + GetY() * (nation + 1))])->Draw(x + DONKEY_X[nation][2], y + DONKEY_Y[nation]);
    }
    // Bei Katapulthaus Katapult oben auf dem Dach zeichnen, falls er nicht "arbeitet"
    else if(type == BLD_CATAPULT && !is_working)
    {
        LOADER.GetImageN("rom_bobs", 1776)->Draw(x - 7, y - 19, 0, 0, 0, 0, 0, 0, COLOR_WHITE, COLOR_WHITE);

        if(worker)
            if(worker->GetObjId() == 696956)
                NormalFont->Draw(x, y, "hallo", 0);
    }

    // Bei Schweinefarm Schweinchen auf dem Hof zeichnen
    else if(type == BLD_PIGFARM && this->HasWorker())
    {
        // Position der 5 Schweinchen für alle 4 Völker (1. ist das große Schwein)
        const int PIG_POSITIONS[NAT_COUNT][5][2] =
        {
            //  gr. S. 1.klS 2. klS usw
            { {3, -8}, {17, 3}, { -12, 4}, { -2, 10}, { -22, 11} }, // Afrikaner
            { { -16, 0}, { -37, 0}, { -32, 8}, { -16, 10}, { -22, 18} }, // Japaner
            { { -15, 0}, { -4, 9}, { -22, 10}, {2, 19}, { -15, 20} }, // Römer
            { {5, -5}, {25, -12}, { -7, 7}, { -23, 11}, { -10, 14} }, // Wikinger
            { { -16, 5}, { -37, 5}, { -32, -1}, { -16, 15}, { -27, 18} } // Babylonier
        };


        /// Großes Schwein zeichnen
        LOADER.GetMapImageN(2160)->Draw(
            x + PIG_POSITIONS[nation][0][0], y + PIG_POSITIONS[nation][0][1], 0, 0, 0, 0, 0, 0, COLOR_SHADOW);
        LOADER.GetMapImageN(2100 + GAMECLIENT.GetGlobalAnimation(12, 3, 1, GetX() + GetY() + obj_id))->Draw(
            x + PIG_POSITIONS[nation][0][0], y + PIG_POSITIONS[nation][0][1]);

        // Die 4 kleinen Schweinchen, je nach Produktivität
        for(unsigned i = 1; i < min<unsigned>(unsigned(productivity) / 20 + 1, 5); ++i)
        {
            //A random (really, dice-rolled by hand:) ) order of the four possible pig animations, with eating three times as much as the others ones
            //To get random-looking, non synchronous, sweet little pigs
            const unsigned char smallpig_animations[63] =
            {
                0, 0, 3, 2, 0, 0, 1, 3, 0, 3, 1, 3, 2, 0, 0, 1,
                0, 0, 1, 3, 2, 0, 1, 1, 0, 0, 2, 1, 0, 1, 0, 2,
                2, 0, 0, 2, 2, 0, 1, 0, 3, 1, 2, 0, 1, 2, 2, 0,
                0, 0, 3, 0, 2, 0, 3, 0, 3, 0, 1, 1, 0, 3, 0
            };
            const unsigned short animpos = GAMECLIENT.GetGlobalAnimation(63 * 12, 63 * 4 - i * 5, 1, 183 * i + GetX() * obj_id + GetY() * i);
//.........这里部分代码省略.........
开发者ID:uqs,项目名称:s25client,代码行数:101,代码来源:nobUsual.cpp


示例11: LOG

HRESULT ui::UIRadioButtonGroup::Render(graphics::D3DInteropHelper *pD3DInteropHelper,
                                       ID2D1RenderTarget *pRenderTarget) {
  for (size_t i = 0; i < GetNumberOfElements(); ++i) {
    auto element = std::dynamic_pointer_cast<UIRadioButton>(GetElement(i));
    D2D1_MATRIX_3X2_F origMatrix;
    pRenderTarget->GetTransform(&origMatrix);
    D2D1_MATRIX_3X2_F matrix = origMatrix * D2D1::Matrix3x2F::Translation(element->GetX(), element->GetY());
    pRenderTarget->SetTransform(matrix);
    HRESULT hr = element->Render(pD3DInteropHelper, pRenderTarget);
    if (FAILED(hr)) {
      LOG(SEVERITY_LEVEL_ERROR) << L"render a child element failed, index = " << i << L", hr = " << hr;
    }
    pRenderTarget->SetTransform(origMatrix);
  }
  return S_OK;
}
开发者ID:yohei-yoshihara,项目名称:GameOfLife3D,代码行数:16,代码来源:UIRadioButtonGroup.cpp


示例12: SetHP

//鳥居
int CBossMystia::Torii(){
	SetHP(2000);
	SetTime(30);
	deffence = 0;
	for( int i = 0; i < 60; ++i ) {
		x += ( 420 - GetX() ) / 60;
		y += ( GAME_CENTER_Y - GetY() ) / 60;
		Suspend(1);
	}
	deffence = 1;
	Suspend(30);
	while( 1 ) {
		for( int k = 0; k < 2; ++k){
			//攻撃
			CTamaNormal tama;
			tama.x = GetX();
			tama.y = GetY();
			tama.type = 3;
			tama.color = 1;
			tama.v = 1;

			CDanmakuSegment d( &tama);
			d.v2 = 1.5;
			d.v1 = 1.5;

			d.a1 = -20;
			d.a2 = -180+20;
			d.Set( 4+4*GetDifficult() );
			d.Fire();
			g_pMaterial->sndFire.Play(0);
			Suspend(40);

			d.a1 = -40;
			d.a2 = +60;
			d.Set( 4+4*GetDifficult() );
			d.Fire();
			d.a1 = 180-60;
			d.a2 = 180+40;
			d.Set( 4+4*GetDifficult() );
			d.Fire();
			g_pMaterial->sndFire.Play(0);
			Suspend(40);

			d.a1 = -20;
			d.a2 = -180+20;
			d.Set( 4+4*GetDifficult() );
			d.Fire();
			g_pMaterial->sndFire.Play(0);
			Suspend(120);

			//移動
			const int move_count = 30;
			int xv,yv;
			if( k ) {
				xv = 400 - GetX();
				yv = GAME_TOP + 120 - GetY();
			}
			else {
				xv = 500 - GetX();
				yv = GAME_BOTTOM - 120 - GetY();
			}
			for( int i = 0; i < move_count; i++ ) {
				x += xv / move_count;
				y += yv / move_count;
				mt.Suspend(1);
			}
			mt.Suspend(120);
		}
	}
	return 1;
}
开发者ID:yohokuno,项目名称:tbm,代码行数:72,代码来源:Mystia.cpp


示例13: CTalkMystia2


//.........这里部分代码省略.........
	SetHP(1000);
	SetTime(30);
	fnb.SetFunction(this,&CBossMystiaBase::NormalAtack1);
	mt.Start(&fnb,0x8000);
	while( !IsEnd() ) mt3.Suspend();
	mt.Stop();

	//横符
	SpellCard();
	fn.SetFunction(this,&CBossMystia::Yoko);
	mt.Start(&fn,0x8000);
	while( !IsEnd() ) mt3.Suspend();
	mt.Stop();
	SpellEnd();

	//通常攻撃
	SetHP(1500);
	SetTime(40);
	fnb.SetFunction(this,&CBossMystiaBase::NormalAtack1);
	mt.Start(&fnb,0x8000);
	while( !IsEnd() ) mt3.Suspend();
	mt.Stop();

	//縦符
	SpellCard();
	fn.SetFunction(this,&CBossMystia::Tate);
	mt.Start(&fn,0x8000);
	while( !IsEnd() ) mt3.Suspend();
	mt.Stop();
	SpellEnd();

	//通常攻撃
	SetHP(2000);
	SetTime(40);
	fnb.SetFunction(this,&CBossMystiaBase::NormalAtack1);
	mt.Start(&fnb,0x8000);
	while( !IsEnd() ) mt3.Suspend();
	mt.Stop();

	//闇符
	yami = 1;
	yami_r = 120;
	SpellCard();
	fn.SetFunction(this,&CBossMystia::Yoko);
	mt.Start(&fn,0x8000);
	while( !IsEnd() ) mt3.Suspend();
	mt.Stop();
	SpellEnd();

	//幕間
	flag = 0;
	deffence = 0;
	mt.Stop();
	mt3.Suspend(60);

	//酉符
	yami = 1;
	yami_r = 60;
	SpellCard();
	fn.SetFunction(this,&CBossMystia::Tate);
	mt.Start(&fn,0x8000);
	while( !IsEnd() ) mt3.Suspend();
	mt.Stop();
	SpellEnd();

	//幕間
	flag = 0;
	deffence = 0;
	mt.Stop();
	mt3.Suspend(60);

	//半円
	yami = 0;
	SpellCard();
	fn.SetFunction(this,&CBossMystia::HalfCircle);
	mt.Start(&fn,0x8000);
	while( !IsEnd() ) mt3.Suspend();
	mt.Stop();
	SpellEnd();

	//エフェクト
	mt.Stop();
	flag = 0;
	deffence = 0;
	g_lEffect.Add( new CEffectBreak( GetX(), GetY() ));
	g_pPlayer->Talk();
	mt3.Suspend( 60 );

	//画面外へ
	x=1000;

	//会話
	pTalk = new CTalkMystia3();
	pTalk->Start();
	while( !pTalk->IsEnd() )
	mt3.Suspend();
	SAFE_DELETE(pTalk);

	return 1;
}
开发者ID:yohokuno,项目名称:tbm,代码行数:101,代码来源:Mystia.cpp


示例14: Initialize

func Initialize()
{
	SetAction("Travel");
	SetRDir(10);
	SetObjectLayer(nil);
	//AddEffect("MoveTo", this, 1, 1, this);
	
	ox=GetX();
	oy=GetY();
	
	rangedummy = CreateObject(Dummy, 0, 0, GetOwner());
	rangedummy.Visibility = VIS_Owner;
	rangedummy->SetAction("HangOnto", this);
		var props =
		{
			R = 255,
			G = 0,
			B = 0,
			Alpha = 40,
			Size = 70,
			BlitMode = GFX_BLIT_Additive,
			Rotation = PV_Step(10, 0, 1),
			Attach = ATTACH_Back | ATTACH_MoveRelative
			
		};
	rangedummy->CreateParticle("Shockwave2", 0, 0, 0, 0, 0, props, 1);
	
	moveparticle =
	{
		Alpha = 100,
		Size = AttackSize * 2,
		R = pR,
		G = pG,
		B = pB,
		Rotation = PV_Random(0,360),
		BlitMode = GFX_BLIT_Additive,
	};
	
	moveparticle2 =
	{
		Size = PV_Linear(2,0),
		BlitMode = GFX_BLIT_Additive,
		R = pR,
		G = pG,
		B = pB,
		Attach=ATTACH_Back,
	};
	
	movetrailparticles =
	{
		Size = PV_Linear(5,0),
		BlitMode = GFX_BLIT_Additive,
		R = pR,
		G = pG,
		B = pB,
		Attach=ATTACH_Back,
	};
	
	followtrailparticles =
	{
		Size = PV_Linear(5,0),
		BlitMode = GFX_BLIT_Additive,
		R = 50,
		G = 50,
		B = 50,
		Attach=ATTACH_Back,
	};
	
	hometrailparticles =
	{
		Size = PV_Linear(5,0),
		BlitMode = GFX_BLIT_Additive,
		R = 0,
		G = 255,
		B = 255,
		Attach=ATTACH_Back,
	};
	
	hometrailparticles2 =
	{
		Size = PV_Linear(2,0),
		BlitMode = GFX_BLIT_Additive,
		R = 0,
		G = 255,
		B = 255,
		Attach=ATTACH_Back,
	};
	
	
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:90,代码来源:Script.c


示例15: TO_USER

/**
* @brief	Executes the death process.
*
* @param	pKiller	The killer.
*/
void CNpc::OnDeathProcess(Unit *pKiller)
{
	CUser * pUser = TO_USER(pKiller);

	if (TO_NPC(this) != nullptr && pUser != nullptr)
	{
		if (pUser->isPlayer())
		{
			if (!m_bMonster)
			{
				switch (m_tNpcType)
				{
				case NPC_BIFROST_MONUMENT:
					pUser->BifrostProcess(pUser);
					break;
				case NPC_PVP_MONUMENT:
					PVPMonumentProcess(pUser);
					break;
				default:
					break;
				}
			}
			else if (m_bMonster) // Seed Quest
			{
				if (m_sSid == 700 || m_sSid == 750)
				{
					if (pUser->CheckExistEvent(STARTER_SEED_QUEST, 1))
						pUser->SaveEvent(STARTER_SEED_QUEST, 2);
				} else if (g_pMain->m_MonsterRespawnListArray.GetData(m_sSid) != nullptr) {
					if (pUser->isPVPZone() || GetZoneID() == ZONE_JURAD_MOUNTAIN)
						g_pMain->SpawnEventNpc(g_pMain->m_MonsterRespawnListArray.GetData(m_sSid)->sSid, true, GetZoneID(), GetX(), GetY(), GetZ(), g_pMain->m_MonsterRespawnListArray.GetData(m_sSid)->sCount);
				} else if (m_tNpcType == NPC_CHAOS_STONE && pUser->isPVPZone()) {
					ChaosStoneProcess(pUser,5);
				}
			}
		}
	}
}
开发者ID:AdemOsman,项目名称:koserver,代码行数:43,代码来源:Npc.cpp


示例16: sizeof

void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
#ifdef BOTS
	// This block is necessary to clean up any bot objects owned by a Client
	Bot::ProcessClientZoneChange(this);
#endif

	zoning = true;
	if (app->size != sizeof(ZoneChange_Struct)) {
		LogFile->write(EQEMuLog::Debug, "Wrong size: OP_ZoneChange, size=%d, expected %d", app->size, sizeof(ZoneChange_Struct));
		return;
	}

#if EQDEBUG >= 5
	LogFile->write(EQEMuLog::Debug, "Zone request from %s", GetName());
	DumpPacket(app);
#endif
	ZoneChange_Struct* zc=(ZoneChange_Struct*)app->pBuffer;

	uint16 target_zone_id = 0;
	uint16 target_instance_id = zc->instanceID;
	ZonePoint* zone_point = nullptr;

	//figure out where they are going.
	if(zc->zoneID == 0) {
		//client dosent know where they are going...
		//try to figure it out for them.

		switch(zone_mode) {
		case EvacToSafeCoords:
		case ZoneToSafeCoords:
			//going to safe coords, but client dosent know where?
			//assume it is this zone for now.
			target_zone_id = zone->GetZoneID();
			break;
		case GMSummon:
			target_zone_id = zonesummon_id;
			break;
		case GateToBindPoint:
			target_zone_id = m_pp.binds[0].zoneId;
			break;
		case ZoneToBindPoint:
			target_zone_id = m_pp.binds[0].zoneId;
			break;
		case ZoneSolicited: //we told the client to zone somewhere, so we know where they are going.
			target_zone_id = zonesummon_id;
			break;
		case ZoneUnsolicited: //client came up with this on its own.
			zone_point = zone->GetClosestZonePointWithoutZone(GetX(), GetY(), GetZ(), this, ZONEPOINT_NOZONE_RANGE);
			if(zone_point) {
				//we found a zone point, which is a reasonable distance away
				//assume that is the one were going with.
				target_zone_id = zone_point->target_zone_id;
				target_instance_id = zone_point->target_zone_instance;
			} else {
				//unable to find a zone point... is there anything else
				//that can be a valid un-zolicited zone request?

				CheatDetected(MQZone, zc->x, zc->y, zc->z);
				Message(13, "Invalid unsolicited zone request.");
				LogFile->write(EQEMuLog::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id);
				SendZoneCancel(zc);
				return;
			}
			break;
		default:
			break;
		};
	}
	else {
		// This is to allow both 6.2 and Titanium clients to perform a proper zoning of the client when evac/succor
		// WildcardX 27 January 2008
		if(zone_mode == EvacToSafeCoords && zonesummon_id > 0)
			target_zone_id = zonesummon_id;
		else
			target_zone_id = zc->zoneID;

		//if we are zoning to a specific zone unsolicied,
		//then until otherwise determined, they must be zoning
		//on a zone line.
		if(zone_mode == ZoneUnsolicited)
		{
			if(target_zone_id == zone->GetZoneID())
			{
				SendZoneCancel(zc);
				return;
			}

			zone_point = zone->GetClosestZonePoint(GetX(), GetY(), GetZ(), target_zone_id, this, ZONEPOINT_ZONE_RANGE);
			//if we didnt get a zone point, or its to a different zone,
			//then we assume this is invalid.
			if(!zone_point || zone_point->target_zone_id != target_zone_id) {
				LogFile->write(EQEMuLog::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id);
				CheatDetected(MQGate, zc->x, zc->y, zc->z);
				SendZoneCancel(zc);
				return;
			}
		}
	}

	if(target_instance_id > 0)
//.........这里部分代码省略.........
开发者ID:Corysia,项目名称:Server,代码行数:101,代码来源:zoning.cpp


示例17: GetX

void Game_Character::BeginJump(const RPG::MoveRoute* current_route, int* current_index) {
	jump_x = GetX();
	jump_y = GetY();
	jump_plus_x = 0;
	jump_plus_y = 0;
	jumping = true;

	bool end_found = false;
	unsigned int i;
	for (i = *current_index; i < current_route->move_commands.size(); ++i) {
		const RPG::MoveCommand& move_command = current_route->move_commands[i];
		switch (move_command.command_id) {
			case RPG::MoveCommand::Code::move_up:
			case RPG::MoveCommand::Code::move_right:
			case RPG::MoveCommand::Code::move_down:
			case RPG::MoveCommand::Code::move_left:
			case RPG::MoveCommand::Code::move_upright:
			case RPG::MoveCommand::Code::move_downright:
			case RPG::MoveCommand::Code::move_downleft:
			case RPG::MoveCommand::Code::move_upleft:
				Move(move_command.command_id);
				break;
			case RPG::MoveCommand::Code::move_random:
				MoveRandom();
				break;
			case RPG::MoveCommand::Code::move_towards_hero:
				MoveTowardsPlayer();
				break;
			case RPG::MoveCommand::Code::move_away_from_hero:
				MoveAwayFromPlayer();
				break;
			case RPG::MoveCommand::Code::move_forward:
				MoveForward();
				break;
			default:
				break;
		}

		if (move_command.command_id == RPG::MoveCommand::Code::end_jump) {
			end_found = true;
			break;
		}
	}

	if (!end_found) {
		// No EndJump found. Move route ends directly
		*current_index = i;
		jumping = false;
		return;
	}

	int new_x = jump_x + jump_plus_x;
	int new_y = jump_y + jump_plus_y;

	if (Game_Map::LoopHorizontal()) {
		int map_width = Game_Map::GetWidth();
		if (new_x < 0) {
			jump_x += map_width;
			new_x += map_width;
		} else if (new_x >= map_width) {
			jump_x -= map_width;
			new_x -= map_width;
		}
	}

	if (Game_Map::LoopVertical()) {
		int map_height = Game_Map::GetHeight();
		if (new_y < 0) {
			jump_y += map_height;
			new_y += map_height;
		} else if (new_y >= map_height) {
			jump_y -= map_height;
			new_y -= map_height;
		}
	}

	if (
		// A character can always land on a tile they were already standing on
		!(jump_plus_x == 0 && jump_plus_y == 0) &&
		!IsLandable(new_x, new_y)
	) {
		// Reset to begin jump command and try again...
		move_failed = true;
		jumping = false;

		if (current_route->skippable) {
			*current_index = i;
			return;
		}

		return;
	}

	SetX(new_x);
	SetY(new_y);
	*current_index = i;

	remaining_step = SCREEN_TILE_WIDTH;
	stop_count = 0;
	max_stop_count = (GetMoveFrequency() > 7) ? 0 : pow(2.0, 9 - GetMoveFrequency());
//.........这里部分代码省略.........
开发者ID:KitoHo,项目名称:Player,代码行数:101,代码来源:game_character.cpp


示例18: main


//.........这里部分代码省略.........

				case RETURN:    /* Go */

					if( curGroundSensor == totalBeacons )
					{
						printf("%s found home at %d\n", rob_cfg.robo_name, GetTime());
						Finish();
					}
					else {
						DetermineAction(beaconToFollow, &lPow, &rPow);
						DriveMotors(lPow, rPow);
					}
				
					break;

				case WAIT: /* Wait for others to visit target */

					if(GetReturningLed())
					{
						SetVisitingLed(0);
						state = RETURN;

						gettimeofday(&t2, NULL);
					}

					DriveMotors(0.0,0.0);

					break;
			}

			//Say(rob_cfg.robo_name);


			rob_state.state = state;

			if( (rob_state.leftAvail = IsObstacleReady(LEFT)) )
				rob_state.left = GetObstacleSensor(LEFT);

			if( (rob_state.rightAvail = IsObstacleReady(RIGHT)) )
				rob_state.right = GetObstacleSensor(RIGHT);

			if( (rob_state.centerAvail = IsObstacleReady(CENTER)) )
				rob_state.center = GetObstacleSensor(CENTER);


			if(IsGPSReady())
			{
				rob_state.x = GetX();
				rob_state.y = GetY();
			}

			// if( IsGPSDirReady() )
			// 	rob_state.dir = GetDir();

			if( IsCompassReady() )
				rob_state.dir = GetCompassSensor();


			if( ( rob_state.beaconVis = IsBeaconReady(beaconToFollow) ) )
			{
				beacon = GetBeaconSensor(beaconToFollow);

				if( ( rob_state.beaconVis = beacon.beaconVisible ) )
					rob_state.beaconDir = beacon.beaconDir;
			}

			send_all_viewer_state_message(&rob_cfg, &rob_state);


			RequestCompassSensor();

			//Request Sensors for next cycle
			if(GetTime() % 2 == 0) {

				RequestObstacleSensor(CENTER);

				if(    (GetTime() % 8) == 0
					|| beaconToFollow == totalBeacons )
					RequestGroundSensor();
				else
					RequestBeaconSensor(beaconToFollow);

			}
			else {
				RequestSensors(2, "IRSensor1", "IRSensor2");
			}
		}

		send_all_viewer_state_message(&rob_cfg, &rob_state);

	}

	printf("Doing cleanup: %s\n", rob_cfg.robo_name);

	CloseAndFreeJoystick();

	cfg_parser_close(&rob_cfg);

	return ret;
}
开发者ID:jfhenriques,项目名称:robo-human,代码行数:101,代码来源:mainRob.c


示例19: GetY

int Game_Character::GetBushDepth() const {
	if (jumping)
		return 0;

	return Game_Map::GetBushDepth(GetX(), GetY());
}
开发者ID:KitoHo,项目名称:Player,代码行数:6,代码来源:game_character.cpp


示例20: sqrt

/**
 * Get the magnitude of the direction vector formed by the joystick's
 * current position relative to its origin
 *
 * @return The magnitude of the direction vector
 */
float Joystick::GetMagnitude() const {
  return sqrt(pow(GetX(), 2) + pow(GetY(), 2));
}
开发者ID:FRC1296,项目名称:CheezyDriver2016,代码行数:9,代码来源:Joystick.cpp



注:本文中的GetY函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetZ函数代码示例发布时间:2022-05-30
下一篇:
C++ GetXid函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap