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 - Infinity Squared Software

Pages: [1]
1
General / SFML And Emulators?
« on: January 13, 2016, 03:11:50 pm »
Hey Guys!
I am looking to create a Gameboy emulator in C++ and need to choose a graphics library. Would SFML be able to work in an emulator or should I learn SDL?
Thanks!

2
SFML projects / Re: My First SFML Game! A Game Like Space Invaders!
« on: December 24, 2015, 05:05:04 am »
Thanks for the opinions for DirectX. There may be a misunderstanding. I will be using Unity and GMS for actual games, but I wanna learn DX just for fun. I don't know why, it's just I saw a cool looking boook and I wanna try to make a emulator and a game engine one day on the far future. Also, I am in highschool and have taught myself everything, so I am not looking to make "real" indie games. Just side stuff. Thanks for the tips, though!

Oh! and BTW Nexus, I thought your SFML book was really cool. I got it for Christmas a couple years ago but never looked at it till I made this game.

3
SFML projects / Re: My First SFML Game! A Game Like Space Invaders!
« on: December 23, 2015, 02:08:05 pm »
Thanks for the tips!

4
SFML projects / My First SFML Game! A Game Like Space Invaders!
« on: December 16, 2015, 10:18:33 pm »
Hey Guys!
     I have been developing games for several years now with Unity 3D and GameMaker: Studio. However, in a burst of motivation, I decided to learn SFML and make a game in it. I am pretty new to OOP in C++, so the code is pretty rough :-\. Although I enjoyed SFML, I am going to learn DirectX since that is largely applied in the AAA game industry from my understanding.

Here is the Git Repo
Here is my website - http://infinitysquaredsoftware.com/

5
General / Re: Help With Space Invaders Style Game Class. Just started SFML.
« on: November 25, 2015, 10:51:57 pm »
OK. I have just recently been diving into OOP stuff. I watch some more thenewboston. Thanks for the help. If I run into anymore problems with this, I'll just read docs and wath C++ videos. THANKS!

6
General / Re: Help With Space Invaders Style Game Class. Just started SFML.
« on: November 25, 2015, 10:35:39 pm »
Sorry to keep hassling you. :-[

So I read the documentation on sf::Drawable.

first I added:
#include <Drawable.hpp>

That gives me this error:
Severity   Code   Description   Project   File   Line
Error (active)      cannot open source file "Drawable.hpp"   SFML Test   c:\Users\Calvin\Documents\Visual Studio 2015\Projects\SFML Test\SFML Test\Source.cpp   4

The thing is, I have graphics.hpp imported, libs and include directories are set up, and I have set the linker options, for debug which I am in.

For the class I did this:
        //Creating an Enemy
        class Enemy : sf::Drawable
        {
        public:
        private:
                virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const
                {
                        sf::RectangleShape enemyShape(sf::Vector2f(35, 15));
                        target.draw(enemyShape);
                }
        };

        Enemy enemy;

This doesn't cause any errors, but it also doesn't accomplish anything more.

Lastly, I added this at the end:
window.draw(enemy);
 

This causes this error:
Severity   Code   Description   Project   File   Line
Error (active)      conversion to inaccessible base class "sf::Drawable" is not allowed   SFML Test   c:\Users\Calvin\Documents\Visual Studio 2015\Projects\SFML Test\SFML Test\Source.cpp   70

and this:
Severity   Code   Description   Project   File   Line
Error   C2243   'type cast': conversion from 'main::Enemy *' to 'const sf::Drawable &' exists, but is inaccessible   SFML Test   c:\users\calvin\documents\visual studio 2015\projects\sfml test\sfml test\source.cpp   70

Once again, sorry if I'm plaguing your life. I looked at SFML a couple years ago and decided it was way to complicated, now, I'm ready to learn. Please let me know if I can give you any more info.

7
General / Re: Help With Space Invaders Style Game Class. Just started SFML.
« on: November 25, 2015, 08:55:39 pm »
Thanks for the reply! Where is the documentation for what you are talking about?

8
General / Help With Space Invaders Style Game Class. Just started SFML.
« on: November 25, 2015, 07:41:51 pm »
Hey Guys!
I just recently started using SFML with C++ and I really enjoy it. However, because I'm new, I have already run into a problem. I am trying to recreate Space Invaders. To create the enemy, I assume my options are to create the enemy, and then copy and paste that code again and again. My other reasonable and cleaner option was to create a class. My problem is, I can't get my classes to work in SFML. Can someone help?

The first thing I do is create a class and then create an object:
        //Creating an Enemy
        class Enemy
        {
        public:
                Enemy::Enemy()
                {
                        sf::RectangleShape shape(sf::Vector2f(25, 25));
                }
        };
       
        Enemy enemyOne;

After that, I call the enemyOne object in the window.draw()
window.draw(enemyOne);

However I get the error:
Severity   Code   Description   Project   File   Line
Error   C2664   'void sf::RenderTarget::draw(const sf::Vertex *,size_t,sf::PrimitiveType,const sf::RenderStates &)': cannot convert argument 1 from 'main::Enemy' to 'const sf::Drawable &'   SFML Test   c:\users\calvin\documents\visual studio 2015\projects\sfml test\sfml test\source.cpp   71

and I get this error:
Severity   Code   Description   Project   File   Line
Error (active)      no instance of overloaded function "sf::RenderWindow::draw" matches the argument list   SFML Test   c:\Users\Calvin\Documents\Visual Studio 2015\Projects\SFML Test\SFML Test\Source.cpp   71

What am I doing wrong and how can I fix it?

Any help would be GREATLY appreciated. I have been making games with game engines (Unity, GM, etc.) and really want to start using SFML.

Pages: [1]
anything