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 - Astrof

Pages: 1 ... 4 5 [6] 7 8 9
76
General / SFML and Box2D
« on: April 03, 2009, 05:05:49 pm »
I'm making a scrolling space shooter so I don't think I'll really have a ground.  Also I saw that Box2D was faster than Chipmunk.  Also eventually I want to make a platformer (probably a Sonic Clone).

So what should I do to match units?  how do pixels and meters coincide (what conversion factor do I have to use)?

77
General / SFML and Box2D
« on: April 03, 2009, 12:46:33 am »
I'm trying to set up Box2D with SFML.  I am kind of confused when it comes to setting up Box2D.  I was wondering if someone had example code that I could use or if someone could help me out with a few questions concerning both libs put together.  

Basically I have SFML::Drawables in my game.  How do I give them Shapes, etc in Box2D so that I can perform collisions with Box2D?  How do I set up the Box2D world (my window is 1024x768...so how big should my World be then)?  If I move an object in Box2D do I have to copy the movement back into the SFML Drawable?  

I am planning on using Box2D mainly for collision.

78
General / 1st Demo Using SFML - Only Get Console Window - HELP
« on: March 13, 2009, 02:24:19 pm »
Sorry, when you said "I haven't"  I thought you meant you had not unplugged them.  My bad.  

Have you tried using the latest source through the SVN?

79
General / 1st Demo Using SFML - Only Get Console Window - HELP
« on: March 11, 2009, 10:07:09 pm »
I would try unplugging them and then trying it, or downloading the latest source through the SVN.  

but you said that the program works fine in Visual Studio?

80
General / #include problem (more C++ related than just SFML)
« on: March 11, 2009, 09:54:59 pm »
woah that's cool; I did not know I could do that.  Thanks!
C++ is still fairly new to me; I'm used to Java and C# where you import (or use) files but do not dump the whole include file into the current file; it just says "Hey I'm using blah blah blah and this is where it is defined."

81
General / #include problem (more C++ related than just SFML)
« on: March 11, 2009, 03:28:46 am »
In my program I'm trying to set up some kind of hierarchy.  A ResourceManager holds the game's resources (which includes Levels), Levels have an Update function which can add enemies to the game if certain criteria are met, and Enemies use the ResourceManager to set its image to its Sprite.  So if I do a #include for each required file, I end up getting an infinite recursive include loop (Visual Studio then throws "too many include files").  Now, if I use a #pragma once (which I had no idea what it was until this day...still don't rly know what it is) I get weird compiler errors (parts of my code that used to work before now dont and now cmath and list are breaking too).  How do I fix this?

EDIT: ok quick "Update:" I thought I had fixed the problem and deleted this thread; however, in my Level file if I comment out #include Enemy.h I do not get any errors; however if I uncomment it I get a plethora of weird erros:

Code: [Select]

Error 14 error C2143: syntax error : missing ';' before '{' C:\Program Files\Microsoft Visual Studio 9.0\VC\include\cmath 20 SFML Game
Error 20 error C2143: syntax error : missing ',' before '<' C:\Program Files\Microsoft Visual Studio 9.0\VC\include\list 20 SFML Game
Error 71 error C2143: syntax error : missing ';' before 'namespace' C:\Program Files\Microsoft Visual Studio 9.0\VC\include\iostream 12 SFML Game


Now I think it's because in my ResourceManager class I have a vector of Level pointers (to store the levels).  For some reason if I include Enemy in level, it breaks something.  Here are the includes in Enemy, Level, and ResourceManager, if that helps:
Code: [Select]

//Level.h
#pragma once
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <vector>

#include "Enemy.h"


#ifndef LEVEL_H
#define LEVEL_H
...

//Enemy.h
#pragma once
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>

#include "ResourceManager.h"
#include "Player.h"
...

//ResourceManager.h
#pragma once
#include <vector>
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include "Level.h"




Another update, I moved most of the local include files into the cpp files.  It mostly has fixed it...until I need to actually put include files into headers.

82
General / 1st Demo Using SFML - Only Get Console Window - HELP
« on: March 09, 2009, 05:22:01 am »
have you tried using a debugger or manually debugging? (using debug couts and printfs to try to figure out where exactly the problem is occurring? ) it could be a problem in the file.

83
General / 1st Demo Using SFML - Only Get Console Window - HELP
« on: March 08, 2009, 07:00:39 pm »
Quote from: "Liosan"
Well, ok. But I don't have one plugged in, I haven't even seen an USB joystick.

I do have several bluetooth HIDs (human interface devices) installed, but not plugged in (for example a Wii remote). Do you think this can be the issue?

Liosan


have you tried unplugging them?

84
DotNet / RenderWindow#EnableKeyRepeat does nothing
« on: March 06, 2009, 03:04:32 am »
EnableKeyRepeat is used for Event Processing.  Instead of using an sf::Input check out sf::Event

Look at the Tutorials sections over events:
http://www.sfml-dev.org/tutorials/1.5/window-events.php
and take a look at the KeyPressed part.

85
Audio / sf::Sound SetPosition, how does it work?
« on: March 05, 2009, 04:11:13 pm »
I just do:
sound.SetPosition(x,value,y);
where value is a value that I experimented with and x and y are the initial position of the object on the screen.  

I did a quick test on a test program and it seems that only small values seem to work.  (It seems that If the x and y values go too far away they are just not heard).  

What units are a sound's position measured in? Because I think I'm using pixel positions to try to map them.  Also is 0,0 the Center of the screen (this could also be a problem with my current code)?

86
Audio / sf::Sound SetPosition, how does it work?
« on: March 05, 2009, 03:39:37 pm »
oh makes sense, thanks!

This is the reason why I stick to 2D game programming...I'm directionally dyslexic.


EDIT: What do I have to set the Y value then to get it to work? It still doesn't play the sound when I do sound.SetPosition(x,value,y) where value is a number (I tried 0,1,-1,100,etc).

87
General / Unicode errors with VS C++ 6 (aka VS98).
« on: March 05, 2009, 03:37:42 pm »
Quote from: "Bonafide"
Thanks for the help Laurent, but I can't seem to find such an option. Google hasn't been much of a help either, I guess I may have to make the switch to SDL  :x .


couldn't you "switch" to a newer version of Visual Studio? (The express editions are free).  Or use Code::Blocks? VS98 is over a decade old...

88
Audio / sf::Sound SetPosition, how does it work?
« on: March 05, 2009, 06:13:03 am »
I'm having trouble getting the SetPosition thing to work.  I'm thinking my problem is my z value, but I'm not exactly sure.  I define a position by doing a sound.setPosition(x,y,0), x and y being the position of the drawable at initialization.  I tried changing the 0 to a 1 or a -1 and it still didn't work (no sound was played).  what am I doing wrong? It's probably something real stupid...

89
Audio / Looping a music from a certain point
« on: March 03, 2009, 07:08:48 pm »
Quote from: "Laurent"
Well, I guess this kind of system could be implemented on top of what SFML provides. I'm not sure this is a core feature that needs to be included in it, it's rather a higher-level feature.


I don't know about others, but I definately would find this feature useful (hence the topic).  Many professional level games have music pieces that start with an intro and go into a full loop (as stated above). Now, i'm sure a workaround would be to break the file into two pieces, but then there's the whole "did I cut the file at the right point" and timing issue (there could be a lag between stopping the first part and starting the next part).  Also, because of the lack of such a feature, many songs that have an intro are just looped multiple times, thus creating a bigger file size.  

Should I repost this in the feature request forum and maybe take a poll?  

Even if it can't be implemented officially, could maybe a wiki post be used with this and SoundStreams?

90
Audio / Looping a music from a certain point
« on: March 01, 2009, 07:22:56 am »
Quote from: "Jesse"
Quote
Can't you do the same thing by inheriting from sf::SoundStream?

Quite possibly! I will look into it :)


If you could find a way to do this using SoundStream and the ogg libs, could you share your code, possible even uploading it onto the wiki?

Pages: 1 ... 4 5 [6] 7 8 9