Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Sivak

Pages: 1 2 3 [4]
46
Graphics / Using one image and taking sectors?
« on: March 21, 2010, 04:28:28 am »
Hey all.  I wondered if it was possible to do something like have a portion of an image be used as a sprite?

Say I had a 50x50 pixel image with 4 25x25 pixel frames on it.  Could I take each of these frames using just the one image and make 4 sprites of it or does it HAVE to be a separate image file for each?

Thanks.

47
General / Handling game logic and such...
« on: March 18, 2010, 04:10:45 pm »
Well, I've tried this, but it's not compiling.

I have 4 HPP files:  screen, screens, screen0, screen1.

screen contains the cScreen class and nothing else.
screens has verbatim what is in the tutorial

Right away, it says cScreen is redefined.  I don't know if this has something to do with the vector and the class?

Other errors include Screen base class undefined and vector conversion problems (though I'm sure these will go away after cScreen is figured out)

I'm using VC++ 2008 express and WinXP.  Thanks.

48
General / Handling game logic and such...
« on: March 18, 2010, 05:05:17 am »
Okay.  I've gotten my program to compile and I can see the 3 PNG files I made up for the title screen thus far.  It's laid out right, etc. etc.

The big problem though is how this is handled.  Using the tutorials, I have this variable:

Code: [Select]

sf::RenderWindow App(sf::VideoMode(640, 480, 32), "Shmuppy");  // the render window


...and it is global.  I don't know if this is bad or not, but it works.  The way I'm intending to do it is have App be used for drawing wherever...

Anyway though...  what I've basically done is made up 2 functions.  main and titleScreen.  I have a variable for the game state, which calls the respective function from main as well as one called navigateMode, which is like the "state within the game state".  This is the approach I've used for my ASM programs.

Anyway, the big problem I have is with the whole title screen.  It's basically doing state 0 all the time, which involves loading the 3 PNGs each frame, making them into sprites, and then drawing said sprites.  Obviously, it should NOT have to load these every frame, but I have no idea where to go from here which would involve loading these separately...

This is the program thus far:
http://pastebin.ca/1844303

I keep wanting to take the approach of having a lot of global variables, but I know that's not the C++ way.   8)

49
Graphics / Black outline when rendering sprite
« on: March 18, 2010, 12:15:25 am »
Hey all.  Sorry to jump in, but I've gotten graphics to display and I wondered if there's a way to have EVERY image loaded with setsmooth to false?  It fixed 2 problems I had with what I was going for displaying.

50
Graphics / App.Clear() crashes program & other problems.
« on: March 17, 2010, 11:50:25 pm »
Wow, I can't believe I missed that.  the -d fixed it all and I've got a PNG background loaded.  Thank you ever so much!

And no, Nvidia.

51
Graphics / App.Clear() crashes program & other problems.
« on: March 17, 2010, 11:29:09 pm »
Hey all.  I've been going through the basics and now I've hit what probably should not be.

The App.Clear() will crash the program no matter what.  I've commented this out and I can have the blank window just fine.  I have no idea why this would happen.  App.Display() works fine.  Empty window and all that.

Also, another problem I seem to be having is I can't open any image files.  Basically, it'll compile, but running the program makes the PC speaker go off and then it finally closes.

Here's what I've got:
-Windows XP SP3
-Visual C++ 2008 express

Pages: 1 2 3 [4]