Goofans Game Discussion

809 replies [Last post]
Joined: 09/01/2009

Ok, cool. Sorry for taking so long.

Btw, when you #define THIS_HEADER_H, you don't have to define it as 1 or anything. It's standard to just define it with no value.

Joined: 12/23/2010

I'm not exactly sure what you mean by "loads of global variables", but if you mean you want global variables that any class/.cpp file can access, maybe a static class containing the required properties would be possible?
I've heard of that as a good solution for global variables in OOP-based AS3 projects, and I'm thinking of using it whenever I need them.

Joined: 08/06/2010

Just upgraded to the newest version of GCC and now my old code is so full of errors I might just rewrite it. What changed so much?

Another Planet finally has an official release! Download chapters 1 through 3 here! Thank you for waiting so long while I kept starting over.

Joined: 09/01/2009

Hmm. Is it the new C++ 11 standard?

Joined: 07/08/2011

AP told me to define it as 1. It's obvious he's still doing old-style C++ which is probably why his code is full of errors.

Joined: 09/01/2009

How do you mean? You've been able to define macros with no value for quite a long time.

Joined: 07/08/2011

HE IS GETTING ERRORS. HOW WOULD I KNOW.

Joined: 08/06/2010

I just used 1 because I wasn't sure what to define it as. Valueless macros aren't covered in my textbook. Tongue

The error are things like: I need to declare private class members before public functions that use them. You didn't need to before.

Another Planet finally has an official release! Download chapters 1 through 3 here! Thank you for waiting so long while I kept starting over.

Joined: 02/20/2011

currency:
1 chip's worth: wood
3: rock
5: stone
10: steel
25: iron
50: bronze
100: silver
250: gold
500: diamond

you start defeating low-level enemies by poking them with a sword handle. every time you kill one, you get a wood chip. 10 of these can be used to make a sword upgrade, and make a wooden sword. OR, you can use these to buy potions at shops.
EDIT: whoops, put it in the wrong section. can you move it, moderator?

-_-

Joined: 01/31/2011

its a game discussion. Put anything game related here, but try to put them in specific areas

Joined: 07/08/2011

Thus his edit.

Joined: 07/08/2011

Current Build. No code this time. Just the binary.

As you can see, I've been trimming the fat. The filesize is noticeably smaller (2,210kb turned to 491kb). This is mainly from eliminating libraries that aren't even required yet (like sound, fonts, png). I think I've decided on a final format for maps as well, so feel free to fool around with the test one (data/maps/test.xml). Please understand that the engine will crash if you change the depth of image elements and then reloading.

Controls: Press 0 to initialize the xml-parser (forgot to automate Tongue). Press F5 to Load/Reload "data/maps/test.xml".

Please post questions here. I'm still working on other elements, but this was an improvement to the previous one due to defining rectangles to draw from images inside the map file itself (view "data/maps/test.xml" to see).

Joined: 01/31/2011

MOM, what does it say about its file size?

ITS OVER 2 THOUSAND!!!

WHAT 2 THOUSAND?!?!

Joined: 08/06/2010

Let me see what the download window says about its file size now...

It's under FIVE HUINDRED!

Five hundred? That's nowhere NEAR nine thousand!

Oh. My bad.

Another Planet finally has an official release! Download chapters 1 through 3 here! Thank you for waiting so long while I kept starting over.

Joined: 09/01/2009

It's a good idea to compile for debug when you're working on a game, since you can use gdb and such to search for problems (I think you can use gdb out of Code::Blocks, I never toyed with it), since it adds a bunch of debug symbols to the executable. These debug symbols take a very large amount of disk space, so if you want, you can compile for release (Build menu->Select target->Release) and that'll cut down on the file size of the executable a lot. Just be sure to set it back to Debug once you're done, since I think it compiles faster then, too.

Joined: 07/08/2011

Hurr

Joined: 02/20/2011

i like messing with the images, putting my name on it.
once, on the other build, i told someone it was a game, and they watched the blue "loading sign" for about 5 minutes!

-_-

Joined: 07/08/2011

HAHA! Laughing out loud I'm glad I got to make someone feel stupid. ;P

I'll go work on it now.

@MOM Yeah, I know about setting it to Release. Tongue I hope you don't think I'm dumb or something, because that's what it seems like. The change in size is like half a megabyte in the actual size (not the zip) so I guess I didn't know that it would be that much of a difference. Tongue

Joined: 07/08/2011

New Build. It's the same link as before. Just some minor changes. But now it has a changelog and the ability to load maps from the command-line. Check out the changelog for more info on changes. Now has a build number.

Tongue

Joined: 02/20/2011

downloaded it.
suggestion: maybe the next build should have insrtuctions on how to do cool stuff with it, how to use it, etc.

-_-

Joined: 07/08/2011

I thought it was pretty straightforward: "I think I've decided on a final format for maps as well, so feel free to fool around with the test one (data/maps/test.xml)."

Joined: 01/31/2011

sweet

Joined: 07/08/2011

How close are you to a sprite sheet?

Joined: 09/01/2009

Naw, not assuming you were dumb or anything, and I think I already said that someplace before, so sorry bout dat.

Joined: 07/08/2011

Better be. Tongue

Joined: 02/20/2011

RedTheGreen wrote:
I thought it was pretty straightforward: "I think I've decided on a final format for maps as well, so feel free to fool around with the test one (data/maps/test.xml)."

What I mean is later on, when there is more stuff. Right now, it isn't that complicated, unless you're a spam bot.

-_-

Joined: 07/08/2011

Oh, other stuff? I'm really unsure on what kind of thing I should add right now. Until we have basic global rules, (velocity-changers like gravity and blow-back) I can't really come up with any entities or similar things. I really need a player sprite-sheet to work with. Once I have a player walking around, I'll be able to create things for the player to interact with.

What do you mean by me being a spam bot?

Joined: 07/08/2011

Build 0003

Changelog wrote:
-'base.xml' created and started
-Background image for base created
-Updated WM title
-Re-added support for PNG images
-Added basic cursor image; change by editing 'data/hard/curs.png'
-Trimmed the fat some more

Joined: 08/06/2010

Basic global rules should be set in the level XML, like in World of Goo (gravity is just another directional force).

For basic physics, each simulated object should have four properties, depending how you implement it: vX, vY, x, and y; or theta, v, x, and y. For a platform game we should probably use the first one.

Then, in the game, just add something like this pseudocode:

  1. if(this->touching(linearforce)){
  2. this->vX += linearforce.dX;
  3. this->vY += linearforce.dY;
  4. }
  5. if(this->touching(ground)){
  6. this->vY *= -ground.bouncefactor;
  7. this->vX *= ground.friction; //Between 0 (can't slide) and 1 (frictionless)
  8. }
  9. if(this->vX<1)
  10. this->vX = 0;
  11. if(this->vY<1)
  12. this->vY = 0;
  13.  
  14. if(this->vY > terminal_velocity){
  15. this->vY = terminal_velocity;
  16. console << "Terminal Velocity!" << endl;
  17. }
  18. if(this->vY < -terminal_velocity){
  19. this->vY = -terminal_velocity;
  20. console << "Negative Terminal Velocity!" << endl;
  21. }
  22. ...
  23. this->x += this->vX;
  24. this->y += this->vY;

and map it to the screen at (x,y). Ta-da! Simple physics simulation!

Another Planet finally has an official release! Download chapters 1 through 3 here! Thank you for waiting so long while I kept starting over.

Joined: 08/06/2010

Of course, you could also use theta and v, then map them to vX and vY:

vX = v*cos(theta);
vY = v*sin(theta);

That would work better for projectiles.

Another Planet finally has an official release! Download chapters 1 through 3 here! Thank you for waiting so long while I kept starting over.