[QUOTE=DeadKiller987;27328248]So, I started to learn LOVE:
[img_thumb]http://anyhub.net/file/1qPI-lualovetext.png[/img_thumb]
So far it's awesome![/QUOTE]
You meant Lua, right?
[QUOTE=Muffinz!;27328352]You meant Lua, right?[/QUOTE]
You know that you can learn to use things like APIs and programming libraries? It's not like when you know the language you know instantly how to use some library.
[QUOTE=Muffinz!;27328352]You meant Lua, right?[/QUOTE]
LOVE is a 2d engine for Lua, dude.
[editline]10th January 2011[/editline]
Now with 100% more typing:
[img]http://anyhub.net/file/1qQN-lovetyping.png[/img]
[QUOTE=NorthernGate;27328100]What happened to GameMonkey? Weren't you all "Oh guys gamemonkey is so fucking sweet yeeahhh bro, fuck lua, this is where its at!" or something similar.[/QUOTE]
A lot has changed since then. Squirrel has got a lot more support behind it.
[img]http://i.imgur.com/Vug7h.png[/img]
[img]http://i.imgur.com/UYp0I.png[/img]
Chaos, doom, fire and lava.
My work here is done.
(Made a NBT reader, and MC map editor in C# Sweet as hell)
Someone puked over your block in the top pic.
[editline].[/editline]
That sarcastic "useful" rating hurt me.
I like the texturepack... it makes me less sad about my own artistic skills :smith:
[IMG]http://i.imgur.com/b3AI0.png[/IMG]
Oh notch, when wil you stop failing, i reseted my world, restarted minecraft, and this chunk... was still there. whit the ghast.... Oh notch.
[QUOTE=bromvlieg;27330305]I like the texturepack... it makes me less sad about my own artistic skills :smith:
[img_thumb]http://i.imgur.com/b3AI0.png[/img_thumb]
Oh notch, when wil you stop failing, i reseted my world, restarted minecraft, and this chunk... was still there. whit the ghast.... Oh notch.[/QUOTE]
"i tinkered with minecraft in a way which wasnt intended then blamed notch for being incompetant when it didnt go back to normal properly"
[QUOTE=Jallen;27330382]"i tinkered with minecraft in a way which wasnt intended then blamed notch for being incompetant when it didnt go back to normal properly"[/QUOTE]
Theres a Delete world button, wich should remove the damn world, instead it dint do that propperly and left a chuck.
If i dint modded that chunk in hell stuff, it might have been a random chunk mountin in water, its a delete error, wich notch should try to fix. its his delete function failing, not my map changeing.
[QUOTE=Jallen;27330382]"i tinkered with minecraft in a way which wasnt intended then blamed notch for being incompetant when it didnt go back to normal properly"[/QUOTE]
Apparently it happens when you delete the world ingame.
I've decided I'm going to delay my little platformer project and go assassinate Notch, so that hopefully the Minecraft trend will die out.
I'll make sure to post pics so you guys can track my progress.
[QUOTE=geel9;27313295][media]http://www.youtube.com/watch?v=ZLs2P9dWFcU[/media]
Shake effect. Point of interest: 2:27. The thunder is awesome.
[editline]9th January 2011[/editline]
Right now it shakes to the intensity of the beat.[/QUOTE]
I should note it also shakes when you get HIT, so that may explain some unexplained shaking
[QUOTE=garry;27325318]More work on my squirrel interface for Botch. Lazy function caller - because pushing and counting arguments sucks.[/QUOTE]
tl;dr - garry discovered varargs
*goes implement same thing in ILuaInterface*
Variadic templates FTW
[QUOTE=ZeekyHBomb;27331378]Variadic templates FTW[/QUOTE]
Not standard yet :(.
Proposed documents are available and gcc has those proposals implemented.
Enough for me to already put them to use :D
C++0x = Good enough.
[QUOTE=ZeekyHBomb;27331645]Proposed documents are available and gcc has those proposals implemented.
Enough for me to already put them to use :D[/QUOTE]
Doesn't clang have them too?
And the latest MSVC?
[editline]10th January 2011[/editline]
At least one of the two?
Where's page 26?
[editline]10th January 2011[/editline]
Oh wait, there it is.
[QUOTE=esalaka;27332113]Doesn't clang have them too?
And the latest MSVC?
[editline]10th January 2011[/editline]
At least one of the two?[/QUOTE]
[url=http://clang.llvm.org/docs/LanguageExtensions.html#cxx_variadic_templates]clang doesn't[/url]
And at least the newest stable release of MSVS doesn't seem to have it:
[quote=http://en.wikipedia.org/w/index.php?title=Visual_C%2B%2B&oldid=403842056]Variadic templates were also considered, but delayed[/quote]
Also, clang fails to compile some, maybe even all of the libstdc++ headers in c++0x mode.
Learning UDK woot.
[QUOTE=garry;27328925]A lot has changed since then. Squirrel has got a lot more support behind it.[/QUOTE]
I thought you were using V8 or tracemonkey or something.
Anyway, Lua supremacy.
Just finished a simple [i]Animation[/i] class, deriving from sf::Sprite. It takes an image (sf::Image) that's already been made transparent by the means of a color key or otherwise, it takes the number of frames, and the framerate (fps).
Nothing to show you really, but it works and here's its functionality:
[cpp]
namespace pf {
class Animation : public sf::Sprite, public IRenderable {
public:
Animation(sf::Image *image, int frames, int framerate);
void Tick(float frametime);
void Render(sf::RenderTarget *target);
void Play();
void Pause();
bool IsPlaying();
int GetCurrentFrame();
void SetCurrentFrame(int frame);
};
};
[/cpp]
Tick() is called whenever it possibly can, and frametime is the amount of seconds that has passed since the last Tick().
[QUOTE=dag10;27332828]Just finished a simple [i]Animation[/i] class, deriving from sf::Sprite.
.....[/QUOTE]
That's like my animation class :] Nice work.
[QUOTE=CyberWatt;27332330]Learning UDK woot.[/QUOTE]
I have a friend who has to use it on his course.
He doesn't like it much.
[editline]10th January 2011[/editline]
[QUOTE=dag10;27332828]Just finished a simple [i]Animation[/i] class, deriving from sf::Sprite. It takes an image (sf::Image) that's already been made transparent by the means of a color key or otherwise, it takes the number of frames, and the framerate (fps).
Nothing to show you really, but it works and here's its functionality:
[cpp]
namespace pf {
class Animation : public sf::Sprite, public IRenderable {
public:
Animation(sf::Image *image, int frames, int framerate);
void Tick(float frametime);
void Render(sf::RenderTarget *target);
void Play();
void Pause();
bool IsPlaying();
int GetCurrentFrame();
void SetCurrentFrame(int frame);
};
};
[/cpp]
Tick() is called whenever it possibly can, and frametime is the amount of seconds that has passed since the last Tick().[/QUOTE]
Why would you make an animation a derivative of [I]sf::Sprite[/I]? If I were doing it I would have animation objects which aren't part of the heirarchy that take a vector of [I]sf::Image[/I]'s and a framerate for the constructor and then have them able to do something like...
[I]anim1.Animate(someSprite);[/I]
Or if you really wanted I guess you could do a very simple override of [I]sf::Sprite[/I] to have a [I]void Animate(Animation anim)[/I] function (maybe call it [I]AnimatedSprite[/I]) so you can do [I]myAnimatedSprite.Animate(anim1);[/I]
I don't see how your solution works if you want more than one animation per sprite? I guess I don't know much about how it works, but just from seeing the interface it's not clear to me.
[QUOTE=dag10;27332828]Just finished a simple [i]Animation[/i] class, deriving from sf::Sprite. It takes an image (sf::Image) that's already been made transparent by the means of a color key or otherwise, it takes the number of frames, and the framerate (fps).
Nothing to show you really, but it works and here's its functionality:
[cpp]
namespace pf {
class Animation : public sf::Sprite, public IRenderable {
public:
Animation(sf::Image *image, int frames, int framerate);
void Tick(float frametime);
void Render(sf::RenderTarget *target);
void Play();
void Pause();
bool IsPlaying();
int GetCurrentFrame();
void SetCurrentFrame(int frame);
};
};
[/cpp]
Tick() is called whenever it possibly can, and frametime is the amount of seconds that has passed since the last Tick().[/QUOTE]
Weird, I always just built animation handling into my entity classes. How are you using a separate class just for animation? Any examples of it being defined for another class or something?
[QUOTE=Jallen;27333101]I have a friend who has to use it on his course.
He doesn't like it much.
[editline]10th January 2011[/editline]
Why would you make an animation a derivative of [I]sf::Sprite[/I]? If I were doing it I would have animation objects which aren't part of the heirarchy that take a vector of [I]sf::Image[/I]'s and a framerate for the constructor and then have them able to do something like...
[I]anim1.Animate(someSprite);[/I]
Or if you really wanted I guess you could do a very simple override of [I]sf::Sprite[/I] to have a [I]void Animate(Animation anim)[/I] function (maybe call it [I]AnimatedSprite[/I]) so you can do [I]myAnimatedSprite.Animate(anim1);[/I]
I don't see how your solution works if you want more than one animation per sprite? I guess I don't know much about how it works, but just from seeing the interface it's not clear to me.[/QUOTE]
I probably should have specified. Basically it takes an image like this:
[img]http://grab.by/8iFs[/img]
[i]Note: That animation was poorly made in paint by me. It's a placeholder until I get better artist skills :v:[/i]
Basically, I create a transparency mask from the sf::Color::Magenta background. When I pass the # of frames in the constructor of pf::Animation, it divides the image's width by the frame count to get the width of the individual frames. Then to display a specific frame in the Render() sequence, it just sets the Sub Rect of the image to display.
Although it publicly derives from sf::Sprite, it's meant to be drawn by calling Render(sf::RenderTarget*). If you just call [i]SomeWindowOrTarget.Draw(MyAnimationInstance)[/i], it won't render the correct frame of the animation. Unless I can figure out how to have the Animation run some sort of code to modify its SubRect whenever it's passed to a sf::RenderTarget::Draw(), then I'll get rid of its Render() method. For now, I'm just deriving from Sprite to eliminate the need to keep an internal Sprite, and so that I can use things like SetScale, SetPosition, etc, right off the bat.
[QUOTE=dag10;27333462]I probably should have specified. Basically it takes an image like this:
[img_thumb]http://grab.by/8iFs[/img_thumb]
[i]Note: That animation was poorly made in paint by me. It's a placeholder until I get better artist skills :v:[/i]
Basically, I create a transparency mask from the sf::Color::Magenta background. When I pass the # of frames in the constructor of pf::Animation, it divides the image's width by the frame count to get the width of the individual frames. Then to display a specific frame in the Render() sequence, it just sets the Sub Rect of the image to display.
Although it publicly derives from sf::Sprite, it's meant to be drawn by calling Render(sf::RenderTarget*). If you just call [i]SomeWindowOrTarget.Draw(MyAnimationInstance)[/i], it won't render the correct frame of the animation. Unless I can figure out how to have the Animation run some sort of code to modify its SubRect whenever it's passed to a sf::RenderTarget::Draw(), then I'll get rid of its Render() method. For now, I'm just deriving from Sprite to eliminate the need to keep an internal Sprite, and so that I can use things like SetScale, SetPosition, etc, right off the bat.[/QUOTE]
Why are you using a transparency mask when png has a perfectly good alpha channel that has negligible performance cost?
png is also lossless and superior when it comes to storage space requirements. If you want an editor which supports transparency, the best one for pixel art is paint.net
You may already know this, but it's best to make sure before you spend effort on things which could be better spent.
[QUOTE=Jallen;27333576]Why are you using a transparency mask when png has a perfectly good alpha channel that has negligible performance cost?
png is also lossless and superior when it comes to storage space requirements. If you want an editor which supports transparency, the best one for pixel art is paint.net
You may already know this, but it's best to make sure before you spend effort on things which could be better spent.[/QUOTE]
I know. I used to have Paint.NET on my old machine, but I'm working on this project at both school and at home (I'm using a portable Code::Blocks environment set up on my 8Gb flash drive). At school I only have access to Paint. And besides, the magenta color key doesn't have any performance cost after the program loads; it's a one-time operation to convert magenta pixels into transparent pixels, remember.
[editline]10th January 2011[/editline]
[QUOTE=Kopimi;27333419]Weird, I always just built animation handling into my entity classes. How are you using a separate class just for animation? Any examples of it being defined for another class or something?[/QUOTE]
I've already created an Entity base class, and a PhysicsEntity class, which moves with gravity and collision detection. Entity is by itself a non-drawable class, so that I can later store point or info entities in my levels. PhysicsEntity however implements my IRenderable interface, which requires it to have a Render(sf::RenderTarget*) method, and usually a Tick(float frametime) method (for controlling logic per tick).
I'm also currently creating my Character class, which implements PhysicsEntity (and therefore IRenderable), and it will control the 2D character in my side-scrolling platform game.
To give you a better idea, here's my IRenderable declaration:
[cpp]namespace pf {
class IRenderable {
public:
virtual void Tick(float frametime) {};
virtual void Render(sf::RenderTarget *target) = 0;
};
};[/cpp]
[editline]10th January 2011[/editline]
I understand pointers in C/++ very well, and I have used them for a long time. I understand that if I do &somevar, it will evaluate to the address of somevar. But one thing that I've never understood and SFML uses a lot is something like this:
[cpp]void Draw(RenderTarget& Target) const;[/cpp] (That's right out of their docs).
What does RenderTarget& Target mean?
[QUOTE=Jallen;27333576]Why are you using a transparency mask when png has a perfectly good alpha channel that has negligible performance cost?
png is also lossless and superior when it comes to storage space requirements. If you want an editor which supports transparency, the best one for pixel art is paint.net
You may already know this, but it's best to make sure before you spend effort on things which could be better spent.[/QUOTE]
Traditionally pixel art games don't use transparency, so there's no point adding a fourth channel for a value that will be either 255 or 0.
Sorry, you need to Log In to post a reply to this thread.