[6080] | 1 | |
---|
| 2 | /* |
---|
| 3 | orxonox - the future of 3D-vertical-scrollers |
---|
| 4 | |
---|
| 5 | Copyright (C) 2004 orx |
---|
| 6 | |
---|
| 7 | This program is free software; you can redistribute it and/or modify |
---|
| 8 | it under the terms of the GNU General Public License as published by |
---|
| 9 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 10 | any later version. |
---|
| 11 | |
---|
| 12 | ### File Specific: |
---|
| 13 | main-programmer: Patrick Boenzli |
---|
| 14 | co-programmer: |
---|
| 15 | */ |
---|
| 16 | |
---|
| 17 | #include "spawning_point.h" |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | /** |
---|
[6081] | 22 | * standard constructor |
---|
[6080] | 23 | */ |
---|
[6083] | 24 | SpawningPoint::SpawningPoint (const Vector& absCoordinate, const World* world) |
---|
[6080] | 25 | {} |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | /** |
---|
[6081] | 29 | * constructor |
---|
| 30 | */ |
---|
[6083] | 31 | SpawningPoint::SpawningPoint (const Vector& position, float frequency, |
---|
| 32 | float seed, int classID, const World* world) |
---|
| 33 | : WorldEntity(position) |
---|
[6081] | 34 | { |
---|
[6083] | 35 | this->frequency = frequency; |
---|
| 36 | this->seed = seed; |
---|
| 37 | this->classID = classID; |
---|
| 38 | this->world = world; |
---|
[6081] | 39 | } |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | /** |
---|
[6080] | 43 | * deconstructor |
---|
| 44 | */ |
---|
| 45 | SpawningPoint::~SpawningPoint () |
---|
| 46 | {} |
---|
| 47 | |
---|
| 48 | |
---|
[6081] | 49 | /** |
---|
| 50 | * spawn the entity |
---|
| 51 | */ |
---|
| 52 | void SpawningPoint::spawn() |
---|
[6083] | 53 | { |
---|
| 54 | PRINTF(5)("Spangingpoint creates a new Entity (id: %i, frequency: %f, seed: %f)\n", this->classID, |
---|
| 55 | this->frequency, this->seed); |
---|
| 56 | BaseObject* spawningEntity = Factory::fabricate(this->classID); |
---|
| 57 | if( LIKELY(this->world != NULL)) |
---|
| 58 | this->world->spawn(dynamic_cast<WorldEntity*>(spawningEntity)); |
---|
| 59 | } |
---|
[6080] | 60 | |
---|
| 61 | |
---|
[6081] | 62 | |
---|
[6080] | 63 | /** |
---|
| 64 | * this method is called every frame |
---|
| 65 | * @param time: the time in seconds that has passed since the last tick |
---|
| 66 | * |
---|
| 67 | * Handle all stuff that should update with time inside this method (movement, animation, etc.) |
---|
| 68 | */ |
---|
| 69 | void SpawningPoint::tick(float dt) |
---|
| 70 | {} |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | /** |
---|
| 74 | * the entity is drawn onto the screen with this function |
---|
| 75 | * |
---|
| 76 | * This is a central function of an entity: call it to let the entity painted to the screen. |
---|
| 77 | * Just override this function with whatever you want to be drawn. |
---|
| 78 | */ |
---|
| 79 | void SpawningPoint::draw() |
---|
| 80 | {} |
---|