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.


Topics - MarcuzPwnz

Pages: [1]
1
General / 'string' file not found.
« on: July 30, 2013, 07:53:00 am »
Hey there SFML community, it's been a while since I've made a thread here and during this time of absence I've obtained a new computer which I'm having trouble setting up so I can develop in C++ using SFML.

Like usual, I feel ridiculous asking questions because I know they're simple yet I can't figure them out (being a noob at this stuff and all)

So basically my problem is that when I compile the default SFML 2.1 project I get an error "'string' file not found" and I'm not even able to #include <iostream> without getting a similar error. I'm using a Mac running the latest version of Mac OSX and I have the latest Xcode installed yet it seems like I'm not even able to compile basic C++ programs, help? :)

Thanks,

MarcuzPwnz.

2
Network / [Solved] receiving multiple packets
« on: March 09, 2013, 09:13:32 am »
Hey there! I have been playing around with the networking in SFML and I have come across a problem, I have spent a good half hour trying to figure this out, by changing code and reading documentation and still I'm stuck.

So here's a problem. My server receives the first packet sent by the client fine, but as soon as the client sends another packet the server extracts the data from the second packet but when I cout the value of the extracted packet it's the same as the first. So I put in an if statement to check if the packet had been read and it turns out the second packet isn't even being read at all. (From what I understand at least)

Server code: http://pastebin.com/4DJbBMJq
Client code: http://pastebin.com/gdur9qvf

Would anyone be able to point me in the right direction or explain what I am doing wrong? it would be much appreciated. :)

Thank you.

3
SFML projects / Space Invaders
« on: March 09, 2013, 04:43:51 am »
It's taken me a while but I'm finally getting the hang of SFML thanks to the help of the community here! :)

I have created a game that is obviously based on Space Invaders but with some minor changes. Unlike the original there are no shields and you can have more than one projectile on screen at a time.



Feel free to give feedback and let me know how high you managed to get your score. ;)

Windows Download: http://www.mediafire.com/?8rc8z64s3mfsapb
Mac Download: http://www.mediafire.com/?8zazs14a85s8b0v

Happy gaming! :D

4
General discussions / General C++ Question
« on: March 07, 2013, 07:48:25 pm »
Hey there everyone. :)

Before I came across C++ and SFML I use to program in Java.

As most of you probably know, in Java there's the ability to write graphics on the screen, for example in an applet. And all of this (applets, graphics, even audio) are all bundled with Java and work out of the box without downloading any external libraries.

Which brings me to my question. Why does C++ not include support for graphics, audio etc. right out of the box? Is it something to do with how Java runs using the JVM to provide cross platform applications etc. and C++ does not?

5
General / Parse Issue
« on: March 04, 2013, 09:19:54 am »
I'm currently getting a problem that I honestly just cannot figure out.

I'm coding Space Invaders, everything was running fine until I started getting this parse issue.

I have tried re-creating the issue in another project but everything works fine when I try to do so.

I also tried re-creating the project incase the project file itself was corrupt or something, that also failed and I still get the issue.

Error message:


I really don't understand why it says 'Ship' is an unknown type, I #included "ship.h" in the projectile header file.

Below are links to the Projectile .cpp and header file, I'm pretty sure my code is accurate (It may not be perfect but it should run right?)

Projectile.cpp: http://pastebin.com/tsNhnWNA
Projectile.h (Getting the error on line 20): http://pastebin.com/Bef53YfE

I have also provided links to the ship .cpp and header files. As I said above I'm pretty sure the code is accurate for them also.

Ship.cpp: http://pastebin.com/a22nYNYB
Ship.h: http://pastebin.com/3m3zec3a

Sorry if this is a simple/annoying question but I really don't know where else to look, I have tried everything I can think of to try and solve this.

Thank you.

6
General / [Mac] Weird problem with running my game on different machines
« on: February 27, 2013, 07:28:12 am »
Hello there SFML users! Today a friend of mine was going to test one of my games for me, it's a basic game of Pong and it runs fine on my machine, but for some reason it will not work on his or my other Mac.

It's built using SFML 2.0 ("made" using CMake for C++11 )and was compiled in Xcode and distributed as an app that can be downloaded here: http://www.mediafire.com/?ql63pdue2qm85ws

All 3 computers we have tested it on are running Mac 10.7.5 but only mine could run the game, the others got the following error: http://i.imgur.com/utQNsfI.png

Am I missing anything? Was I suppose to include some .dll (or Mac equivalent) files with the .app or something?

Compiler Info:
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

Thanks. :)

7
General / C++11 and Code::Blocks
« on: February 22, 2013, 08:29:50 am »
I can't seem to get my game to compile and run using C++11 features.

I have used the to_string() function in my code which is part of the C++11 standard.

I have told Code::Blocks to have g++ to follow C++11 ISO language standard and all I get is the following error:


I am using SFML 2.0-rc and I'm compiling with MinGW 4.6.2


Thanks. :)

8
General / Compiling on Windows
« on: February 21, 2013, 07:31:34 am »
Hello there! I have recently been coding a small game using SFML, it is called Pokemon Pong. It's pretty much just a Pokemon themed version of the original Pong.

I'm having a slight problem though. I can not seem to get this to compile on Windows so I can share my work with friends.

It compiles, runs and plays perfect on Mac, just when ever I stick all the files into Code::Blocks on my windows VM and compile I get errors thrown at me from all directions (Not SFML, I ran a basic SFML app beforehand and it worked fine)

So if anyone is able to compile this would you be able to show me step by step how you did it?

The download below contains all the source files along with the images and sounds for the game. :)

Download: http://www.mediafire.com/?dbbmvrubgsiu3up

9
General / Networking and Code::Blocks
« on: February 17, 2013, 05:00:36 am »
Hello there! I have been trying to compile the following code in Code::Blocks

#include <iostream>
#include <SFML/Network.hpp>

using namespace sf;
using namespace std;

int main(){
    cout << "Would you like to be a server or client? (s/c)" << endl;
    char choice;
    cin >> choice;
    if(choice == 's'){
        TcpListener listener;
        listener.listen(1337);
        std::string message = "";
        Packet serverPacket;
        while(true){
            TcpSocket client;
            if(listener.accept(client) == Socket::Done){
                cout << "Client has connected from " << client.getRemoteAddress() << endl;
                cout << "Send message to client: ";
                cin >> message;
                serverPacket << message;
                client.send(serverPacket);
            }
        }
    }else{
        Packet clientPacket;
        std::string messageSent;
        TcpSocket socket;
        if(socket.connect("localhost", 1337)){
            cout << "Unable to find server." << endl;
        }else{
            cout << "Connected to server!" << endl;
        }
        while(true){
            socket.receive(clientPacket);
            if(clientPacket >> messageSent){
                cout << "[Server] " << messageSent << endl;
            }
        }
    }
    return 0;
}

I have followed the tutorial for SFML 2.0 on Windows using Code::Blocks and can run most applications I make fine.

I have only added sfml-graphics-s, sfml-window-s and sfml-system-s and their debugging equivalents to my linker options, am I suppose to add sfml-network-s to make this code compile and run correctly? :)

The reason I have not tried this myself already is because I'm not sure if sfml-network-s even exists and if it does what order I would add it into the linker options.

Thanks for reading. :)


10
General / C++11 and SFML 2.0
« on: February 14, 2013, 04:42:46 am »
I was working with the network module from SFML 2.0 this morning and tried to use the std::thread class that was introduced in C++11 and noticed that I could only use sf::Thread class from SFML.

Am I doing something wrong? or is C++11 not supported yet on SFML 2.0?

As a side note I'm on a Mac so I'm not sure if that's the issue.

11
SFML projects / [First SFML Project] 2D Minecraft
« on: February 09, 2013, 07:45:12 am »
Here it is, my first real SFML project. I worked on this for many hours (mostly time wasted as I spent hours trying to figure out how to do stuff and failed miserably at it) It's Minecraft in 2D! :)

Features:
> 6624 Block Map with camera that scrolls across map
> Player movement including jumping and falling
> Collision detection between the player and all the blocks on the map
> Breaking & Placing blocks
> A block selector (only top 2 rows work)
> Music & sounds
> Grass grows on dirt blocks with air above them and grass blocks that don't have an air block above them turn to dirt

I created this in Xcode (on my Mac) and it compiles fine but when I tried compiling it on Windows using Code::Blocks it threw a whole bunch of errors in my face (generic C++ errors, nothing to do with SFML)



The .app file and source code can be downloaded here: http://www.mediafire.com/?c8xb0wj51tvv9mx

Most importantly, I would love it if people could criticize how badly I coded this. I am new to SFML and C++ and would really love to improve on my programming skills, all the feedback I get helps.

Thank you for reading. :)

12
Graphics / [Simple] How to output an integer on the screen as Text
« on: February 08, 2013, 04:30:12 am »
How would I set an sf::Text to hold an int variable so when I draw the Text to the screen it would output my integer, the reason I don't want to just set it to a String that stores "1" is because I want to be able to change and display new values stored in this Text.

I have read the documentation of the sf::Text class and had a play around with the Text class in my IDE and still haven't figured this out.

Would anyone be able to help me out? Thanks. :)

13
When I try to play music from another class I get an error.

I have the music defined in my second class under public and have just been using SecondClass.button_click.play(); in my main class to play the music. (button_click is the name of the music I'm trying to play.)

The error I get is:
"Failed to play audio stream: sound parameters have not been initialized (call Initialize first)"

I tried calling the initialize() function on button_click but initialize() is a protected member of the Music class so obviously I can't. :(

Any ideas on how I could fix this?

14
General / [Mac] Help Please?
« on: January 23, 2013, 11:03:22 am »
I'm interested in using SFML, but I'm having trouble getting it to work.
I followed the tutorials page and used the wizard to instal SFML v2.0.

I am using a Mac with the following specs:
13-inch mid 2010
Processor:  2.4 GHz Intel Core 2 Duo
Memory:  4 GB 1067 MHz DDR3
Graphics:  NVIDIA GeForce 320M 256 MB
Software:  Mac OS X Lion 10.7.5 (11G63)

How I ended up with this error:

1. I create a new project from the Xcode 4 home screen
http://i.imgur.com/c2oh9k2.png

2. I then chose the SFML application
http://i.imgur.com/c2oh9k2.png

3. I then name it and leave the settings as they are
http://i.imgur.com/CkrpDjD.png

4. I am then presented with the default project and simply click run
http://i.imgur.com/0EWfAve.png

5. I am then presented with the following error
http://i.imgur.com/ZXasH1G.png

Here is the error in more detail:
http://i.imgur.com/9IwqZMX.png

I am using Xcode Version 4.5.2 (4G2008a) with the default compiler from what I know. (I didn't play around with any settings)

This works fine for creating console applications using the cstdlib.

Thanks to anyone who can help me out. :)

Pages: [1]
anything