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

Pages: 1 2 3 [4] 5 6 ... 13
46
Everything Nexus said is correct, just wanted to reiterate and show more examples.

"constexpr" its the same than "#define" but more oriented to define variables ?

constexpr int arraySize{15};
int array[arraySize]; // Valid C++11 code, arraySize is a constexpr

constexpr int getArraySize(int x) { return 15 + x; }
int array2[getArraySize(15)]; // Valid C++11, getArraySize(15) can be evaluated at compile-time

int main() {
    int temp;
    cin >> temp;

    int array3[getArraySize(temp)]; // Unvalid code, getArraySize(temp) cannot be evaluated at compile-time
    cout << getArraySize(temp) << endl; // Valid code, but getArraySize(temp) will be evaluated at run-time
}
 

Please correct me if my example above contains any mistake.


aaaand.... I don't understand how this code:

shape.setSize({paddleWidth, paddleHeight});

is equivalent to this one:

shape.setSize(Vector2f(paddleWidth, paddleHeight));

How exactly works the initialization with { } ? Mmm

Basically, there are occasions when the compiler can automatically "guess" the type, and it's not necessary to specify it. Example:

Vector2f getMyVector1() { return Vector2f(5.f, 5.f); }
Vector2f getMyVector2() { return {5.f, 5.f}; }
// The two functions are practically equivalent

Very interesting link: http://programmers.stackexchange.com/questions/133688/is-c11-uniform-initialization-a-replacement-for-the-old-style-syntax

47
SFML projects / Re: operation bloodshed - (WIP)
« on: November 24, 2013, 06:38:13 pm »
Good job on the project so far Vittorio!! I think you are a really talented programmer. This game has a really unique style, when its finished, I wonder how big will its success be ^^

Thanks for the kind words! :)

Also, the tutorial was finally uploaded on YouTube.
I've created a thread in General Discussion:
http://en.sfml-dev.org/forums/index.php?topic=13677

Hope you will find it useful!

48
Hello SFML community!

I've created a 40 minutes tutorial/screencast on the creation of a complete game using C++11 and SFML2.
The end result is a playable Arkanoid/Breakout clone with a paddle, a ball and destroyable bricks.

This is my first attempt at a complete C++11 game development tutorial.
I divided the code in 9 segments, that I analyze and execute individually.

The video is aimed at people with at least a basic knowledge of C++.
Having some knowledge about common game development concepts will also greatly help.

The point of the video is showing how easy it is to create something playable thanks to the new standard and thanks to SFML, and to show a possible train of thought that can be taken during game development.



I greatly appreciate comments and criticism, and ideas for future videos/tutorials.

Also, feel free to fork the game's source code at:
https://github.com/SuperV1234/Tutorials
and expand upon it: I will feature the best forks in a future video :)

For other tutorials: http://vittorioromeo.info/tutorials.html - or just browse my YT channel.

Thanks for watching!


49
SFML projects / Re: operation bloodshed - (WIP)
« on: November 24, 2013, 04:32:24 pm »
Thank you both for the interesting comments. I have adapted and refined a 160~ lines of code C++11 + SFML arkanoid clone I have talked about at my local Linux Day and created a 30 minutes long screencast, where I analyze the code (segmented in 7 executable parts), showing the thought process behind the creation of a simple C++11 game with SFML.

After it's done uploading I will post it here on the forums.

I also really like the ideas suggested by Nexus - I could do short videos in the future about particular techniques such as Entity management or serialization, etc...

Anyway, I'm sure the feedback on my first tutorial will also be very helpful for the future ones.

50
SFML projects / Re: operation bloodshed - (WIP)
« on: November 23, 2013, 12:37:17 pm »
new video - GUI, force fields, bullet boosters



In the video:
* GUI system: A graphical user interface for the editor, written from scratch with no prior knowledge of GUI code design.
* Force fields: they prevent player and/or the enemies movement in the opposite direction. Can be turned on/off.
* Bullet force fields: they prevent player and/or enemies bullet from passing through a specific side. Can be turned on/off.
* Bullet boosters/direction changers: they alter the bullets's velocity - useful for trap creation and multi-directional turrets.
* Acceleration-based player movement
* Other minor changes...

I've also created a Facebook page for the game (WIP), which I will use for future video updates:
http://www.facebook.com/operationbloodshed

And I've also had the idea of creating tutorial screencasts about modern C++11 game development for beginners. What do you think? Is someone interested?

51
SFML projects / Re: operation bloodshed - (WIP)
« on: November 16, 2013, 06:26:39 pm »
For how long have you been programming? I think this stuff is just incredibly awesome, for being made only by one person

Thanks!  ;D

I've been programming since I was 11 or 12 (I'm 19) -  I started with VB inside Microsoft Excel, then moved to VB.NET, then to C#. After that, I discovered GNU/Linux and C++ and never looked back :)

52
SFML projects / Re: operation bloodshed - (WIP)
« on: November 15, 2013, 06:09:44 pm »
Just thought I'd give a little update: I've been working on the editor interface.



Never thought programming a GUI from scratch would be so hard: focusing the correct widgets in nested lists, textbox focusing and text entering, and culling off-form widgets all gave me headaches... but it seems to work now.

Video coming soon!



Looks very nice! Need to check out the code. ;)

Thanks!
Code is here (still heavy WIP): https://github.com/SuperV1234/SSVBloodshed/tree/master/include/SSVBloodshed/GUI

53
SFML projects / Re: operation bloodshed - (WIP)
« on: November 09, 2013, 06:34:35 pm »
Needed a GUI system for the editor, so I created one...


54
SFML projects / Re: operation bloodshed - (WIP)
« on: October 22, 2013, 10:37:23 am »
new video - vending machines, on/off pressure plates, explosives, ...


In the video:
* Healing vending machine
* New pressure plate type
* More elements have IDs that can be bound to pressure plates
* Explosive crates!
* New trapdoor type
* Weapon sprite changes

Not in the video:
* Major refactoring and performance improvements

Probably in next video:
* Switches (alternative to pressure plates)
* Sensors (alternative to pressure plates that bullets can trigger)

55
SFML projects / Re: operation bloodshed - (WIP)
« on: October 08, 2013, 11:45:38 am »
new video - new elements, multi-level sectors


In the video:
* Editing 32x speed timelapse
* Playthrough of a multi-level sector
* New elements (green/red doors, trapdoors, enemy spawners)
* More aggressive enemies (tweaked bouncing)
* Energy shard collection

Also...


56
SFML projects / Re: operation bloodshed - (WIP)
« on: September 30, 2013, 04:05:54 pm »
new videos - many new elements / example room



In the videos:
* New element: destructible wall
* New elements: doors and pressure plates
* New elements: laser beam turret, plasma cannon turret
* New enemy type: enforcer (shoulder-mounted plasma cannon)
* Many new editor features

57
General discussions / Re: Anyone interested in collaboration
« on: September 30, 2013, 01:05:36 pm »
intermediate C++ user

Quote
still have to learn pointers

uhm

58
SFML projects / Re: operation bloodshed - (WIP)
« on: September 29, 2013, 04:05:54 pm »
new video - fully working level editor


In the video:
* Level saving/loading: levels created in the editor are now playable
* Simple editor mouse controls: mousewheel + modifiers to change brush size, rotation and tile types
* Construction and gameplay of two example levels

59
SFML projects / Re: operation bloodshed - (WIP)
« on: September 28, 2013, 04:34:04 pm »
new video - particle blendmodes, ai changes, plasma bombs, wip level editor


In the video:
* Particle systems now can have a specific blendmode: addition works great for plasma effects!
* Minor ai changes: when an enemy doesn't see you, he moves around to find a trajectory
* Plasma bombs: new projectile type that explodes into plasma bolts
* wip level editor: just started creating a level editor that saves/loads from JSON

60
SFML projects / Re: operation bloodshed - (WIP)
« on: September 27, 2013, 05:32:14 pm »
Sorry I didn't see that link to tigsource!  :-X
Anyway, it looks good! I don't know Operation Carnage, but I loved Smash TV. ^^

Try it! It's abandonware (free) and a lot of fun. :)
http://www.midnightsynergy.com/ancient.htm

---

Today I spent all day on a weapon system.
It sucks, it introduces unnecessary complexity and makes heavy use of capturing lambdas... but:

* Creating new weapons is very easy
* Weapons have a lot of flexibility (it's not a bunch of parameters, it's a lambda that can do anything)
* Thanks to value semantics, I can have copies of weapons with slight variations
* I can easily give an enemy, the player or a turret a certain weapon both at compile-time and run-time and it will work

Example code explained:


1. Notice the return type, `OBWpn`. It's not a reference or a pointer, it's a copy. This allows, for example, to have an enemy use a special version of an existing weapon.
2. For simple weapons, such as the first one (`EPlasmaBulletGun`), the `onShoot` delegate does not capture anything. Non-capturing lambdas with Don Clugston's fast delegates get inlined by clang++ as a normal function call. Yes. (g++ does a worse job, but it's still faster than capturing lambdas).
3. Every projectile the weapon creates goes through `mWpn.shotProjectile`, which fires a callback other entities can attach to. So I could have a "piercing bullets power-up", that, when active, attaches to `OBWpn::onShotProjectile(OBCProjectile&)` delegate, and sets every spawned projectile as piercing.
4. In case of a power-up that modifies the way the weapon shoots, and not projectile parameters, there is a similar delegate in `OBCWpnController`, a component attached to entities with guns that controls fire delay and contains a `OBWpn` object.

So, let's analyze `createEPlasmaGun(int mFanCount)`.

The first instruction creates a `OBWpn` object called result, with parameters:
* Shoot delay: 75.f
* Projectile damage: 1.f
* Projectile speed: 260.f
* Sound ID: "Sounds/machineGun.wav"

The second instruction subscribes (`+=`) a capturing lambda to the weapon's `onShoot` delegate. Inside the lambda we tell the weapon to create `PJStarPlasma` projectiles and fire them in a fan-like formation. When the shots have been fired, we adjust their speed so that "outer" shoots are slower.

Then we return the weapon to the caller.



It works, but it's very messy. Does anyone have any suggestion on how to improve it?

Pages: 1 2 3 [4] 5 6 ... 13
anything