2011-06-23 21:48:52

Hi,
I have just downloaded bgt and read most of the tutorials and decided to create a game. I don't understand the code at all. The game I want to create is just going to be a simple how many objects can you pick up in a certain time game lol.
Help would be apreciated,
Best regards,
Lauren

It is better to remain silent and be thought a fool, than to open your mouth and remove all doubt. -Abraham Lincoln

2011-06-24 02:28:53

There are many different ways one could go about accomplishing what you're wanting to do.

First, are we talking about something in realtime with items on some sort of map? Or something else entirely?
In either case, how are the objects stored?
You could have a class representing the objects, and have an array holding them. Or, you could have an array or 2d array representing the map and have objects be entries in the array. And so on...

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2011-06-24 08:06:01

It would be a sidescroler, a bit like the bonus levvel in q9.

It is better to remain silent and be thought a fool, than to open your mouth and remove all doubt. -Abraham Lincoln

2011-06-24 12:09:32

Would the objects be moving, or would they be in a fixed position?

If moving, I'd recommend using a class to represent them.

For something like in q9, where the items fall from above, I'd do something like...


class Item {

int type; // You could use a string for this, but ints would be more efficient.
double x;
double y;

Item() {
type=random(0, types); // Where you'd replace types with how many types there are. If you only need one, change this to type=0 or remove it entirely.
x=random(minX, maxX); // replace minX and maxX with the maximum and minimum x positions.
y=top; // Replace top with how high you want items to start.
}
}

And then the items would need to fall every so often, and updating a sound to represent their location would come in handy.

Of course, that's just the item definition. That doesn't actually run the game or anything. yikes

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2011-06-24 15:58:07

ok yeah they're falling from the sky.
This is going to be difficult lol smile

It is better to remain silent and be thought a fool, than to open your mouth and remove all doubt. -Abraham Lincoln

2011-06-26 18:50:58

lol, I've read that manual thingy so many times, and I've only understood how to print text, a bit of how to use variables, and that's it.
I have a lot of  talents, but I don't seem to have one in programming smile

I'm probably gonna get banned for this, but...

2011-06-26 19:42:02

What I've found while learning is that it's almost never a good idea to start out with a specific game in mind and try to learn how to do that. It's better to come up with something you can do with what you do understand. That will help you master the basics and go on to more complex things.

It's much easier to start with a prompt-and-alert game than a realtime game with full audio.

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2011-06-26 21:20:30

I completely agree with CAE_Jone's recommendation.  Make a mental list of everything you know how to do, and figure out what you can do with those pieces.  It is better to start out that way.

- Aprone
Please try out my games and programs:
Aprone's software

2011-06-26 21:51:45

thanks for your help everyone

It is better to remain silent and be thought a fool, than to open your mouth and remove all doubt. -Abraham Lincoln