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

Pages: [1]
1
General / How to create own classes from SFML classes
« on: February 09, 2013, 07:58:27 pm »
I'm guessing the title made you cringe from the amateurishness. But that's what I want to know, I started C++ and SFML last week, I know how to create a simple class in C++, I know how to draw, move etc. objects created from SFML classes, but what I do not know is how to combine those classes. For example if I want to make space invaders and have the player's object shoot bullets. How would I go about creating my own class that uses SFML for the player and the bullets? Do I inherit the class, like "class Player: public sf::RectangleShape" (assuming I want my player to be a rectangle)? Because that didn't work out so well.
I'm suspecting the majority of answers will be along the lines of: "Go read a book on C++".

Pages: [1]