Du bist nicht angemeldet.

Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!

Werbeanzeige

matthias

Alter Hase

  • »matthias« ist der Autor dieses Themas

Beiträge: 449

Wohnort: wipperfürth

  • Private Nachricht senden

11

19.11.2006, 17:08

C-/C++-Quelltext

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef SPIELER_H
#define SPIELER_H

#include "main.h"
#include "ITarget.h"
#include "Spiel.h"

class Bulletmanager;
class ITarget;

class Spieler : public ITarget
{
    friend class Spiel;
    friend class Map;
public:
    Spieler(std::string filename, int soundPan);
    void setSpiel(Spiel* spiel);
    ~Spieler(void);
    void renderGameScreen(dus::Surface* surface, float time);
    void renderStatsScreen(dus::Surface* surface,  float time);

    void update1(float time);
    void update2(float time);

    void onItem(ITEM_TYPE item); 
    void changeWeapon(ITEM_TYPE type);

    //Inputübergabe

    void leftPressed(float time);
    void rightPressed(float time);
    void upPressed(float time);
    void downPressed(float time);
    void firePressed(float time);

    Item*               weapon;
    ivec2               weaponOffsetLeft;
    ivec2               weaponOffsetRight;
    Bulletmanager*      bulletsGun1;
    Bulletmanager*      bulletsGun2;
    Bulletmanager*      bulletsGun3;
    Bulletmanager*      bulletsBFG;
    int                 points;

    bool hit(BulletType type, int hits);
    void bulletCollision(ITarget* gegner, ivec2 gegPos, ivec2 gegSize);


    float               camy;
    int             soundPan;
    
private:
    void renderPlayer(dus::Surface* surface);
    Spiel* spiel;
    int camspeed;
    dus::ivec2 playerpos;
    
    int mass;
    dus::ivec2 oldpos;
    dus::ivec2 moveVec;
    
    int collisions;

    int playerHeight;
    int playerWidth;

    dus::Surface* splayer;          
    dus::AnimationSet* playerAnimSet;   
    dus::Animated* playerAnim;  
    dus::Counter*  counter;

    static Surface* suffHealth;

    void SetPlayerPos(ivec2 newPlayerPos, int player);
};

#endif
"In those days spirits were brave, the stakes were high, men were REAL men, women were REAL women, and small furry creatures from Alpha Centauri were REAL small furry creatures from Aplha Centauri."

Lemming

Alter Hase

Beiträge: 550

Beruf: Schüler

  • Private Nachricht senden

12

19.11.2006, 17:16

In welchem Header wird MyGame definiert?
Bzw. Muss main.h in spieler.h eingebunden werden? evtl. kommt er damit nicht klar...
Es gibt Probleme, die kann man nicht lösen.
Für alles andere gibt es C++...

matthias

Alter Hase

  • »matthias« ist der Autor dieses Themas

Beiträge: 449

Wohnort: wipperfürth

  • Private Nachricht senden

13

19.11.2006, 17:29

includes mache ich mittlerweile nach dem trial/error Verfahren, manchmal funktionierts :lol:
"In those days spirits were brave, the stakes were high, men were REAL men, women were REAL women, and small furry creatures from Alpha Centauri were REAL small furry creatures from Aplha Centauri."

Lemming

Alter Hase

Beiträge: 550

Beruf: Schüler

  • Private Nachricht senden

14

19.11.2006, 17:42

matthias
LOL
vll gefällt ihm ja irgendwas daran, dass in main.h spieler.h inkludiert wird und in spieler.h main.h inkludiert wird nicht...
Es gibt Probleme, die kann man nicht lösen.
Für alles andere gibt es C++...

matthias

Alter Hase

  • »matthias« ist der Autor dieses Themas

Beiträge: 449

Wohnort: wipperfürth

  • Private Nachricht senden

15

19.11.2006, 17:56

gibt es da eine bessere Vorgehensweise? Alle in der main includieren und dann überall main einbinden oder so ? :lol:
"In those days spirits were brave, the stakes were high, men were REAL men, women were REAL women, and small furry creatures from Alpha Centauri were REAL small furry creatures from Aplha Centauri."

matthias

Alter Hase

  • »matthias« ist der Autor dieses Themas

Beiträge: 449

Wohnort: wipperfürth

  • Private Nachricht senden

16

19.11.2006, 19:53

ich hab die MyGame Funktionsdefinitionen mal in die main.cpp gepackt, daran lag es wohl. :oops:
"In those days spirits were brave, the stakes were high, men were REAL men, women were REAL women, and small furry creatures from Alpha Centauri were REAL small furry creatures from Aplha Centauri."

Werbeanzeige