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

Pages: [1]
1
General discussions / Re: SFML Game Jam Submissions!
« on: August 05, 2013, 05:20:10 pm »
First of all, thanks for hosting this jam. I really enjoyed having an excuse to crank something out. This one had me up all night in a crunch to finish!

Here are some screens:




Well, it's not quite as finished as I'd like, but I think I made good enough progress and at least it's playable. The story is that your most prized diamond was stolen by a cave-dwelling band of thieves. You must infiltrate their caves and take back what's yours! Oh, and also whatever treasure you manage to find along the way. Beware: the thieves won't go down without a fight! After finding the diamond, you must survive your escape back to the surface!

Controls:
Arrow keys: move and aim
X: Throw ninja rope
Z: Jump and release ninja rope
C: Drop bomb (limited supply)
Enter or space: restart game after death

Features:
Randomly generated levels
Dynamically lit world
Fully destructible terrain

Anyway, here's the download for Windows:
lite-jam.zip (3.5mb)

I do wish I had more time to spend on the spriting, they were all quite rushed since I wanted to focus on coding everything. Can you believe that in a jam with a light/shadow theme I didn't implement lighting until the last two hours?! My excuse is that I started late and worked slowly :P I'm just glad it came together in the end, so I hope you all enjoy it.

Source code of release:
lite-src.zip
It includes my C::B project, but can be built and linked to SFML any of the usual ways. The only other dependency is that C++11 support must be enabled on the compiler suite (-std=c++11).

Cheers!

2
Graphics / Spell Effects
« on: July 13, 2011, 07:03:17 am »
The effect you are referring to is implemented with a technique called color cycling, very common in retro games. Back then, they used hardware limitations to their advantage by shifting palette colors around to imitate animation at almost no processing cost. Unfortunately it can be a bit hard to represent on high-level hardware, but a few people still do it. Check out the demos here:

http://www.effectgames.com/effect/article.psp.html/joe/Old_School_Color_Cycling_with_HTML5

If you play around in the options you can see the palette as the image changes. Also, a friend of mine whipped up something similar in opengl, I can try and track it down for ya.

Over and out

3
Graphics / Inverting a sprite
« on: July 13, 2011, 04:22:48 am »
Thanks that did the trick! Complete shader:
Code: [Select]
uniform bool invert;
uniform sampler2D textu1;

void main()
{
    vec4 ref = texture2D(textu1, gl_TexCoord[0].xy) * gl_Color;
    if(invert)
    {

       gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0) - ref;
       gl_FragColor.a = ref.a;
    }
    else
        gl_FragColor = ref;
}


You can toggle the inversion with:
Code: [Select]

invert.SetParameter("invert",true);

4
Graphics / Inverting a sprite
« on: July 13, 2011, 03:03:42 am »
Hello, I'm trying to invert the colors for a single sprite and I can't seem to get it right. How do I receive the current pixel's color (from the sprite) in the shader? At first I tried gl_Color to no avail:
Code: [Select]

uniform bool invert;

void main()
{
    if(invert)
        gl_FragColor = vec4(255.0 - gl_Color.r, 255.0 - gl_Color.g, 255.0 - gl_Color.b, 1.0);
    else
        gl_FragColor = gl_Color;
}


I also tried another google-inspired solution:
Code: [Select]

uniform bool invert;
uniform sampler2D screenColorBuffer;

void main()
{
    vec4 color =  gl_TexCoord[0];
    if(invert)
    {
        gl_FragColor = 1.0-texture2D(screenColorBuffer,gl_TexCoord[0].st);
        gl_FragColor.a = 1.0;
    }
    else
        gl_FragColor = color;
}


Maybe I'm just not sure what to search for... this GLSL stuff is impossible to sort out for some reason. Is there a certain variable I should use in this scenario?

Thanks

5
Graphics / Shaders don't work when running as a screensaver
« on: May 12, 2011, 03:42:03 pm »
I'm writing a screensaver using SFML 2.0, however I am running into some problems with shaders.

I should state that I haven't written a "formal" windows api screensaver, I am using the normal main and only renaming the screensaver from .exe to .scr while I am testing. This is legal and in fact works in setting up the display/drawing, but for some reason shaders fail to work.

At first I thought there might have been a problem with the execution directory but even when hard-coding the shader location it was failing. After some debugging I discovered SFML was simply unable to use shaders when the extension was changed to .scr.

Also, slightly off-topic, but has anyone had any success with screensavers in SFML in the past? Did you use <screensaver.h> and go through the "proper" windows protocol? I'm trying to decide if I should even bother with the winapi or just stick with main and command line switches. I also can't decide if I really need SFML or not... I'm really only using it to get an opengl context and load the fragment shaders which could easily be done the old-fashioned way.

6
General discussions / Problem compiling SFML 2.0 program
« on: February 04, 2011, 09:06:54 am »
Quote

The Download Page list the latest non SFML2 trunk as SFML 1.7

Yeah that's what I checked but I meant 1.6.

Quote
In SFML 1.x it was SFML_DYNAMIC for dynamic libraries.

Sounds right, that's what I was thinking about.

7
General discussions / Problem compiling SFML 2.0 program
« on: February 03, 2011, 11:56:26 pm »
Ah sounds familiar, but.. Did you always have to do this? I can't remember if I had to use it in 1.7 or not. Regardless, it's working great now, thanks for the help Laurent!

8
General discussions / Problem compiling SFML 2.0 program
« on: February 03, 2011, 11:45:59 pm »
Yes.

Edit: Strangely enough, compiling against the dynamic libraries works just fine.

9
General discussions / Problem compiling SFML 2.0 program
« on: February 03, 2011, 11:28:24 pm »
I followed the instructions to build SFML 2.0 with CMake and it seemed to work without a problem. So now I try to compile against the library but I keep getting errors:
Code: [Select]
obj\Debug\Game.o: In function `Game':
C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:13: undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:13: undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKSsmRKNS_15ContextSettingsE'
C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:14: undefined reference to `_imp___ZN2sf6Window17SetFramerateLimitEj'
C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:27: undefined reference to `_imp___ZN2sf5ImageC1Ev'
C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:28: undefined reference to `_imp___ZN2sf5Image12LoadFromFileERKSs'
C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:30: undefined reference to `_imp___ZN2sf5Image9SetSmoothEb'
C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:13: undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:13: undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKSsmRKNS_15ContextSettingsE'
C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:14: undefined reference to `_imp___ZN2sf6Window17SetFramerateLimitEj'
C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:27: undefined reference to `_imp___ZN2sf5ImageC1Ev'
C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:28: undefined reference to `_imp___ZN2sf5Image12LoadFromFileERKSs'
C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:30: undefined reference to `_imp___ZN2sf5Image9SetSmoothEb'
obj\Debug\Game.o:C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:58: undefined reference to `_imp___ZN2sf6Window5CloseEv'
obj\Debug\Game.o:C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:55: undefined reference to `_imp___ZN2sf6Window8GetEventERNS_5EventE'
obj\Debug\Game.o:C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:60: undefined reference to `_imp___ZNK2sf6Window8GetInputEv'
obj\Debug\Game.o:C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:63: undefined reference to `_imp___ZN2sf5Color5BlackE'
obj\Debug\Game.o:C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:63: undefined reference to `_imp___ZN2sf12RenderTarget5ClearERKNS_5ColorE'
obj\Debug\Game.o:C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:65: undefined reference to `_imp___ZN2sf6Window7DisplayEv'
obj\Debug\Game.o:C:/Users/Mitchell/Programming/Projects/Demise/Game.cpp:52: undefined reference to `_imp___ZNK2sf6Window8IsOpenedEv'
collect2: ld returned 1 exit status


So yeah, what might cause this? The program is trivially simple, it's just a basic game loop at the moment. I have the compiler/linker search directories set correctly and everything, and I'm using the exact same compiler I used to compile SFML (TDM-GCC). Using SVN revision 1786

Pages: [1]
anything