Page 2 of 6

Re: anyone wanna make an UGH! remake?

Posted: Fri Dec 05, 2008 5:30 pm
by avansc
if you work hard, and do as i advice, i promise we will at least have a version that you can fly around in. with collisions.

Re: anyone wanna make an UGH! remake?

Posted: Fri Dec 05, 2008 5:43 pm
by PixelP
avansc wrote:if you work hard, and do as i advice, i promise we will at least have a version that you can fly around in. with collisions.
Great, what's up next?

Re: anyone wanna make an UGH! remake?

Posted: Fri Dec 05, 2008 5:45 pm
by avansc
post the classes you made so i can see if we need to work on them

Re: anyone wanna make an UGH! remake?

Posted: Fri Dec 05, 2008 5:46 pm
by avansc
my bad, i see em

Re: anyone wanna make an UGH! remake?

Posted: Fri Dec 05, 2008 5:49 pm
by avansc
okay, those will work nice. no add some member functions to the level class.

we will need.
add_object(int x, int y, int w, int h);
move_object(&objectclass, int x, int y);
change_object(&objecclass, int w, int h);

Re: anyone wanna make an UGH! remake?

Posted: Fri Dec 05, 2008 5:55 pm
by PixelP
avansc wrote: add_object(int x, int y, int w, int h);
Can you explain how this functions is going to be like?

Re: anyone wanna make an UGH! remake?

Posted: Fri Dec 05, 2008 5:58 pm
by avansc
PixelP wrote:
avansc wrote:okay, those will work nice. no add some member functions to the level class.

we will need.
add_object(int x, int y, int w, int h);
move_object(&objectclass, int x, int y);
change_object(&objecclass, int w, int h);
How is these functions going to work out?
i just mean that you should put
add_object
move_object
change_object

to your level class.

and actually move and chage object will have parameters

move_object(objecClass *obj, int x, int y);

i mean you can call then whatever you want. just functions that can alter the objects.

Re: anyone wanna make an UGH! remake?

Posted: Fri Dec 05, 2008 6:04 pm
by avansc
PixelP wrote:I've made the two classes:

Code: Select all

//object.h
#pragma once

class ObjectClass {
    public:
        int x, y;
        int w, h;
};

Code: Select all

//level.h
#pragma once

class LevelClass {
    public:
        ObjectClass levelData[10];
        int ObjectCount;
};

sorry, you should also have a count of how many object you currently have in your level

Code: Select all

new_Object(int x, int y, int w, int h)
{
    this->ObjectCount++;

    if(this->ObjectCount >9)
        return

    this->Object[this->ObjectCount].x = x;    
    this->Object[this->ObjectCount].y = y;  
    this->Object[this->ObjectCount].w = w;    
    this->Object[this->ObjectCount].h = h;  
}

Re: anyone wanna make an UGH! remake?

Posted: Fri Dec 05, 2008 6:06 pm
by PixelP

Code: Select all

//level.h
#pragma once

class LevelClass {
    public:
        ObjectClass levelData[10];

        void add_object(int x, int y, int w, int h);
        void move_object(ObjectClass* obj, int x, int y);
        void change_object(ObjectClass* obj, int w, int h);
};

void LevelClass::add_object(int x, int y, int w, int h) {
    //????????????
}

void LevelClass::move_object(ObjectClass* obj, int x, int y) {
    obj->x = x;
    obj->y = y;
}

void LevelClass::change_object(ObjectClass* obj, int w, int h) {
    obj->w = w;
    obj->h = h;
}
I didn't figure out how I sould do add_object().

Re: anyone wanna make an UGH! remake?

Posted: Fri Dec 05, 2008 6:09 pm
by avansc
check one up

Re: anyone wanna make an UGH! remake?

Posted: Fri Dec 05, 2008 6:20 pm
by PixelP

Code: Select all

void LevelClass::add_object(int x, int y, int w, int h) {
    this->objectCount++;

    if(this->objectCount > 9) {
        return;
    }

    this->levelData[this->objectCount].x = x;
    this->levelData[this->objectCount].y = y;
    this->levelData[this->objectCount].w = w;
    this->levelData[this->objectCount].h = h;
}

Re: anyone wanna make an UGH! remake?

Posted: Fri Dec 05, 2008 6:27 pm
by avansc
okay. great. now i'll let you have some input on the matters. do you wanna do some graphics first or moce on to the player object.
its up to you.

Re: anyone wanna make an UGH! remake?

Posted: Fri Dec 05, 2008 6:39 pm
by PixelP
Hehe, I'm not that good at graphics.

Re: anyone wanna make an UGH! remake?

Posted: Fri Dec 05, 2008 6:45 pm
by PixelP

Code: Select all

//debug.h
#pragma once

class DebugClass {
    private:
        std::fstream debugFile;

    public:
        DebugClass();
        void DebugLine(std::string str);
};

DebugClass::DebugClass() {
    debugFile.open("debug.txt", std::fstream::out);
}

void DebugClass::DebugLine(std::string str) {
    debugFile << str << std::endl;
    debugFile.flush();
}
I made a debug class

Re: anyone wanna make an UGH! remake?

Posted: Fri Dec 05, 2008 6:48 pm
by avansc
okay thats fine. lets make the player class.
what do you think are all values we should store???