GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing raw.githubusercontent.com — raw.githubusercontent.com // ----------------------------------------------------------------
// From Game Programming in C++ by Sanjay Madhav
// Copyright (C) 2017 Sanjay Madhav. All rights reserved.
//
// Released under the BSD License
// See LICENSE in root directory for full details.
// ----------------------------------------------------------------
#include "BallActor.h"
#include "Game.h"
#include "Renderer.h"
#include "MeshComponent.h"
#include "Mesh.h"
#include "BallMove.h"
#include "AudioComponent.h"
BallActor::BallActor(Game* game)
:Actor(game)
,mLifeSpan(2.0f)
{
//SetScale(10.0f);
MeshComponent* mc = new MeshComponent(this);
Mesh* mesh = GetGame()->GetRenderer()->GetMesh("Assets/Sphere.gpmesh");
mc->SetMesh(mesh);
mMyMove = new BallMove(this);
mMyMove->SetForwardSpeed(1500.0f);
mAudioComp = new AudioComponent(this);
}
void BallActor::UpdateActor(float deltaTime)
{
Actor::UpdateActor(deltaTime);
mLifeSpan -= deltaTime;
if (mLifeSpan < 0.0f)
{
SetState(EDead);
}
}
void BallActor::SetPlayer(Actor* player)
{
mMyMove->SetPlayer(player);
}
void BallActor::HitTarget()
{
mAudioComp->PlayEvent("event:/Ding");
}
|
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |