SunQuest
           Game Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #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: 35 Achayan Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 6 h 12 m 19 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"); ?>
Click here for more information.
 
Join Date: Jan 2005
Location: Internet
Posts: 5,791 gimp User rank is General 7th Grade (Above 100000 Reputation Level)gimp User rank is General 7th Grade (Above 100000 Reputation Level)gimp User rank is General 7th Grade (Above 100000 Reputation Level)gimp User rank is General 7th Grade (Above 100000 Reputation Level)gimp User rank is General 7th Grade (Above 100000 Reputation Level)gimp User rank is General 7th Grade (Above 100000 Reputation Level)gimp User rank is General 7th Grade (Above 100000 Reputation Level)gimp User rank is General 7th Grade (Above 100000 Reputation Level)gimp User rank is General 7th Grade (Above 100000 Reputation Level)gimp User rank is General 7th Grade (Above 100000 Reputation Level)gimp User rank is General 7th Grade (Above 100000 Reputation Level)gimp User rank is General 7th Grade (Above 100000 Reputation Level)gimp User rank is General 7th Grade (Above 100000 Reputation Level)gimp User rank is General 7th Grade (Above 100000 Reputation Level)gimp User rank is General 7th Grade (Above 100000 Reputation Level)gimp User rank is General 7th Grade (Above 100000 Reputation Level)  Folding Points: 1555 Folding Title: Novice Folder
Time spent in forums: 2 Months 2 Weeks 4 Days 57 m 25 sec
Reputation Power: 1469
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.
__________________
A work in progress: Card Game Platform (Status: On Hold) | 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.”

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: 35 Achayan Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 6 h 12 m 19 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: 35 Achayan Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 6 h 12 m 19 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


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway