anyone wanna make an UGH! remake?

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: anyone wanna make an UGH! remake?

Post 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.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
PixelP
Chaos Rift Regular
Chaos Rift Regular
Posts: 153
Joined: Tue Oct 07, 2008 12:23 pm
Programming Language of Choice: c/c++
Location: sweden
Contact:

Re: anyone wanna make an UGH! remake?

Post 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?
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: anyone wanna make an UGH! remake?

Post by avansc »

post the classes you made so i can see if we need to work on them
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: anyone wanna make an UGH! remake?

Post by avansc »

my bad, i see em
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: anyone wanna make an UGH! remake?

Post 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);
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
PixelP
Chaos Rift Regular
Chaos Rift Regular
Posts: 153
Joined: Tue Oct 07, 2008 12:23 pm
Programming Language of Choice: c/c++
Location: sweden
Contact:

Re: anyone wanna make an UGH! remake?

Post 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?
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: anyone wanna make an UGH! remake?

Post 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.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: anyone wanna make an UGH! remake?

Post 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;  
}
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
PixelP
Chaos Rift Regular
Chaos Rift Regular
Posts: 153
Joined: Tue Oct 07, 2008 12:23 pm
Programming Language of Choice: c/c++
Location: sweden
Contact:

Re: anyone wanna make an UGH! remake?

Post 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().
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: anyone wanna make an UGH! remake?

Post by avansc »

check one up
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
PixelP
Chaos Rift Regular
Chaos Rift Regular
Posts: 153
Joined: Tue Oct 07, 2008 12:23 pm
Programming Language of Choice: c/c++
Location: sweden
Contact:

Re: anyone wanna make an UGH! remake?

Post 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;
}
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: anyone wanna make an UGH! remake?

Post 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.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
PixelP
Chaos Rift Regular
Chaos Rift Regular
Posts: 153
Joined: Tue Oct 07, 2008 12:23 pm
Programming Language of Choice: c/c++
Location: sweden
Contact:

Re: anyone wanna make an UGH! remake?

Post by PixelP »

Hehe, I'm not that good at graphics.
User avatar
PixelP
Chaos Rift Regular
Chaos Rift Regular
Posts: 153
Joined: Tue Oct 07, 2008 12:23 pm
Programming Language of Choice: c/c++
Location: sweden
Contact:

Re: anyone wanna make an UGH! remake?

Post 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
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: anyone wanna make an UGH! remake?

Post by avansc »

okay thats fine. lets make the player class.
what do you think are all values we should store???
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Post Reply