Game Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesGame Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 15th, 2007, 04:08 AM
Achayan Achayan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 39 Achayan Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 7 h 28 m 53 sec
Reputation Power: 0
Need Help for VC.Net

Hi all

I am very new to gaming and i am trying to learn gaming
i am using .net 2005 .. Problem is coming here

sprite.h
Code:
#ifndef SPRITE_H
#define SPRITE_H
#include "drawEngine.h"

enum
{
    SPRITE_CLASSID,
};

struct vector
{
    float x;
    float y;
};

class Sprite
{
public:
    Sprite(DrawEngine *de, int s_index, float x= , float y=1, int i_lives=1);
    ~Sprite();
    vector getPosition(void);
    float getX(void);
    float getY(void);
    virtual void addLives(int num = 1);
    int getLives(void);
    bool isAlive(void);
    virtual bool move(float x, float y);
protected:
    DrawEngine *drawArea;
    vector pos;
    int spriteIndex;
    int numLives;
    int classID;
    void draw(float x, float y);
    void erase(float x, float y);
    vector facingDirection;
};

#endif

sprite.cpp
Code:
#include "sprite.h"
Sprite::Sprite(DrawEngine *de, int s_index, float x = 1, float y = 1, int i_lives = 1)
{
    drawArea = de;
    pos.x = x;
    pos.y = y;
    spriteIndex = s_index;
    numLives = i_lives;
    facingDirection.x = 1;
    facingDirection.y = 0;
    classID = SPRITE_CLASSID;
}
Sprite::~Sprite()
{
    erase(pos.x,pos.y);
}
vector Sprite::getPosition(void)
{
    return pos;
}
float Sprite::getX(void)
{
    return pos.x;
}
float Sprite::getY(void)
{
    return pos.y;
}
void Sprite::addLives(int num)
{
    numLives += num;
}
int Sprite::getLives(void)
{
    return numLives;
}
bool Sprite::isAlive(void)
{
   
    return (numLives > 0);

}
bool Sprite::move(float x, float y)
{
    erase(pos.x,pos.y);
    pos.x += x;
    pos.y += y;
    facingDirection.x = x;
    facingDirection.y = y;
    draw(pos.x,pos.y);
    return true;
}
void Sprite::draw(float x, float y)
{
    drawArea->drawSprite(spriteIndex,x,y);
}
void Sprite::erase(float x, float y)
{
    drawArea->eraseSprite(x,y);
}

error list

Error 1 error C2143: syntax error : missing ')' before '*' d:\kurian\dotnet\vc\evlmonkeys\evlmonkeys\sprite.h 19
Error 2 error C2143: syntax error : missing ';' before '*' d:\kurian\dotnet\vc\evlmonkeys\evlmonkeys\sprite.h 19
Error 3 error C2460: 'Sprite:rawEngine' : uses 'Sprite', which is being defined d:\kurian\dotnet\vc\evlmonkeys\evlmonkeys\sprite.h 19
Error 4 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\kurian\dotnet\vc\evlmonkeys\evlmonkeys\sprite.h 19
Error 5 error C2062: type 'int' unexpected d:\kurian\dotnet\vc\evlmonkeys\evlmonkeys\sprite.h 19
Error 6 error C2327: 'Sprite:rawEngine' : is not a type name, static, or enumerator d:\kurian\dotnet\vc\evlmonkeys\evlmonkeys\sprite.h 29
Error 7 error C2065: 'de' : undeclared identifier d:\kurian\dotnet\vc\evlmonkeys\evlmonkeys\sprite.cpp 2
Error 8 error C2597: illegal reference to non-static member 'Sprite:rawEngine' d:\kurian\dotnet\vc\evlmonkeys\evlmonkeys\sprite.cpp 2
Error 9 error C2062: type 'int' unexpected d:\kurian\dotnet\vc\evlmonkeys\evlmonkeys\sprite.cpp 2
Error 10 error C2143: syntax error : missing ';' before '{' d:\kurian\dotnet\vc\evlmonkeys\evlmonkeys\sprite.cpp 3
Error 11 error C2447: '{' : missing function header (old-style formal list?) d:\kurian\dotnet\vc\evlmonkeys\evlmonkeys\sprite.cpp 3

Realy i cant understand whats going on

please any one can help and i am attaching the full source code also..i hope i will get help

http://www.filefactory.com/file/2d3dc9/

Thanks

Kurian

Reply With Quote
  #2  
Old August 15th, 2007, 12:43 PM
gimp's Avatar
gimp gimp is offline
<?PHP user_title("gimp"); ?>
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jan 2005
Location: Internet
Posts: 7,652 gimp User rank is General 77th Grade (Above 100000 Reputation Level)gimp User rank is General 77th Grade (Above 100000 Reputation Level)gimp User rank is General 77th Grade (Above 100000 Reputation Level)gimp User rank is General 77th Grade (Above 100000 Reputation Level)gimp User rank is General 77th Grade (Above 100000 Reputation Level)gimp User rank is General 77th Grade (Above 100000 Reputation Level)gimp User rank is General 77th Grade (Above 100000 Reputation Level)gimp User rank is General 77th Grade (Above 100000 Reputation Level)gimp User rank is General 77th Grade (Above 100000 Reputation Level)gimp User rank is General 77th Grade (Above 100000 Reputation Level)gimp User rank is General 77th Grade (Above 100000 Reputation Level)gimp User rank is General 77th Grade (Above 100000 Reputation Level)gimp User rank is General 77th Grade (Above 100000 Reputation Level)gimp User rank is General 77th Grade (Above 100000 Reputation Level)gimp User rank is General 77th Grade (Above 100000 Reputation Level)gimp User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 2540 Folding Title: Novice Folder
Time spent in forums: 3 Months 6 Days 1 h 35 m 4 sec
Reputation Power: 6083
Send a message via AIM to gimp
Code:
Sprite(DrawEngine *de, int s_index, float x= , float y=1, int i_lives=1);

Looks like you're assigning ... nothing to x. But you're trying to.
__________________
Chat Server Project & Tutorial | WiFi-remote-control sailboat (building) | Joke Thread
“Rational thinkers deplore the excesses of democracy; it abuses the individual and elevates the mob. The death of Socrates was its finest fruit.”
Use XXX in a comment to flag something that is bogus but works. Use FIXME to flag something that is bogus and broken. Use TODO to leave yourself reminders. Calling a program finished before all these points are checked off is lazy.
-Partial Credit: Sun

If I ask you to redescribe your problem, it's because when you describe issues in detail, you often get a *click* and you suddenly know the solutions.
Ches Koblents

Reply With Quote
  #3  
Old August 15th, 2007, 11:26 PM
Achayan Achayan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 39 Achayan Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 7 h 28 m 53 sec
Reputation Power: 0
Quote:
Originally Posted by gimp
Code:
Sprite(DrawEngine *de, int s_index, float x= , float y=1, int i_lives=1);

Looks like you're assigning ... nothing to x. But you're trying to.


yes gimp your true but now issue is very diffrent

Error 1 error C2572: 'Sprite::Sprite' : redefinition of default parameter : parameter 5 d:\kurian\dotnet\vc\evlmonkeys\evlmonkeys\sprite.cpp 3


Error 2 error C2572: 'Sprite::Sprite' : redefinition of default parameter : parameter 4 d:\kurian\dotnet\vc\evlmonkeys\evlmonkeys\sprite.cpp 3


Error 3 error C2572: 'Sprite::Sprite' : redefinition of default parameter : parameter 3 d:\kurian\dotnet\vc\evlmonkeys\evlmonkeys\sprite.cpp 3

Whats its means ??

Reply With Quote
  #4  
Old August 15th, 2007, 11:56 PM
Achayan Achayan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 39 Achayan Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 7 h 28 m 53 sec
Reputation Power: 0
yes i got it i am sorry i got the issue

in header file and source file i am trying to declare value
Sprite(DrawEngine *de, int s_index, float x=1 , float y=1, int i_lives=1);
so i removed the value Sprite(DrawEngine *de, int s_index, float x, float y, int i_live);
in header its working with no issue

sorry for disturbing u people

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesGame Development > Need Help for VC.Net

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap