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

Pages: [1]
1
Graphics / Re: Array of shapes
« on: March 13, 2017, 10:39:41 pm »
Can I do this in a structure? I don't really know a lot about classes and I don't like to have code in my program that I don't fully understand...

2
Graphics / Array of shapes
« on: March 13, 2017, 07:58:41 pm »
Hey,

I'm learning C++ in school(I already know i/o, decision making, loops, arrays, structs, strings, and functions), but I wanted to go a little far and learn how to create 2d graphics, I found SFML and it's going fine.

I'm trying to replicate a Space Invaders game using this video(it's a long video, you don't need to watch), but it is in JavaScript so I'm translating it to C++. But I'm stuck creating the aliens (shapes), because I don't know how to create an array of them. Do I make a struct and each time I call alien.show() it creates a new one, or should I create them outside the struct and then make it appear (by setting its position)?

Sorry if this kind of question appears here very often, or I did not explain myself very good but I'm new to the forum and English is not my main language.
Any help appreciated!

Pages: [1]