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

Pages: 1 [2] 3 4 ... 6
16
I am getting a crash in my game and the console is getting this message printed in it..


Code: [Select]
Assertion failed: progress >= 0.f && progress <= 1.f, file h:\nom!\_xternlibs\sfml2\include\thor\animation\frameanimation.hpp, line 115
The strange thing is the crash only happens sometimes. If I compile, it will run, and then I run it a few times and suddenly it will crash with this error, with no code change at all. If I compile a release version, same thing happens, I can just sit there running the exe, and 1/2 the time it works.. the other 1/2 it crashes.

Anyideas?

Here is my code if it helps.

#include "goPac.h"

goPac::goPac()
        : _nextDirection(STOPPED)
        , _velocity(10.0f)
        , _maxVelocity(100.0f)
{
        _PACsprite.setTexture(*TextureManager::getInstance().rSpriteSheet());


        thor::FrameAnimation defaultAnim;
        defaultAnim.addFrame(1.f, sf::IntRect(40, 80, 40, 40));

        // Create animation: CHOMP
        thor::FrameAnimation chomp;
        chomp.addFrame(1.f, sf::IntRect(120, 80, 40, 40));
        chomp.addFrame(1.5f, sf::IntRect(160, 80, 40, 40));
        chomp.addFrame(1.f, sf::IntRect(120, 80, 40, 40));
        chomp.addFrame(2.f, sf::IntRect(40, 80, 40, 40));

        animPac.setDefaultAnimation(defaultAnim, sf::seconds(1.f));
        animPac.addAnimation("chomp", chomp, sf::seconds(0.4f));
}

goPac::~goPac()
{
}

void goPac::Update(sf::RenderWindow& rw, sf::Event& _event, float TimeElapsed)
{
        rw.pollEvent(_event);
        rw.setKeyRepeatEnabled(false);


        if (_event.type == sf::Event::KeyPressed)
        {
                if (_event.key.code == sf::Keyboard::Up || _event.key.code == sf::Keyboard::W || _event.key.code == sf::Keyboard::Num8)
                {
                        debug("UP");
                        playAnimation();

                }

                if (_event.key.code == sf::Keyboard::Left || _event.key.code == sf::Keyboard::A || _event.key.code == sf::Keyboard::Num4)
                {
                        debug("LEFT");
                }

                if (_event.key.code == sf::Keyboard::Right || _event.key.code == sf::Keyboard::D || _event.key.code == sf::Keyboard::Num6)
                {
                        debug("RIGHT");
                }

                if (_event.key.code == sf::Keyboard::Down || _event.key.code == sf::Keyboard::S || _event.key.code == sf::Keyboard::Num2)
                {
                        debug("DOWN");
                }

        }

        animPac.update(animClock.restart());
        animPac.animate(_PACsprite);
}

void goPac::playAnimation()
{
        debug("playAnimation();");
        animPac.update(animClock.restart());
        animPac.playAnimation("chomp", true);
}

void goPac::Draw(sf::RenderWindow& rw)
{
        rw.draw(_PACsprite);
}


17
SFML projects / Re: Zoost & Zoom : Geometry, animations and graphics
« on: July 11, 2012, 04:18:11 pm »
had a look at this last night but was unable to get it to compile with cmake in windows

18
still a bit shaky on this but I "think" it runs....

ArkBreker-Linux

You may need to run the .sh file... if you can not then sudo chmod +x ArkBreaker.sh first

19
added a linux version.. still a bit shaky on this but I "think" it runs....

ArkBreker-Linux

You may need to run the .sh file... if you can not then sudo chmod +x ArkBreaker.sh first

20
But you can simply provide the SFML libraries with your application.

ok.. how would I "include" the binaries.. I have tried copying the files into the same dir as the executable. but no luck... can you explain what you mean?

21
General / Problems compiling an release SFML2 application on linux
« on: July 04, 2012, 01:35:24 am »
Hi I am trying to compile on linux, (ubuntu) but I am having a problem with static linking. I would like to static link as there isn't a sfml2 pack out people can easily install. Everything compiles fine normally, but if I add the -s to the linker then it all goes haywire.

log - http://ctrlv.it/id/MzAwMzky



Maybe static isn't the way to go? But if I remove the -s and the #define it will now compile fine and even play, like in code::blocks when i press the build/run button... the application runs... but then if i go to the file itself.. as in the one I would post and send to people to use, it will not run?



22
SFML projects / Re: Thor 2.0
« on: June 29, 2012, 04:08:07 am »
1) aniamtion.getFrameNumber(); ---- It would be cool to be able to test witch frame the animation is on at any give refresh for the window. This could be used for a lot of stuff.. say syncing audio ques for example.
As already mentioned in the other thread, I plan to improve the module to implement such functionality more easily. What this implies concretely -- I don't know yet.

Awesome!

2) When adding a animation you use a std::string as the identity key. Would be great if this could be over loaded to also be able to use simple int.
Are you using Thor 1.1? Because the Thor 2.0 Git version allows you to use any type as identifier (thor::Animator is a class template).

Ahh sweet.. yeah I was just going off the demo example, and it used strings.. cool that it can use ints.. I'll prob switch to that for my next one.

23
SFML projects / Re: Thor 2.0
« on: June 28, 2012, 11:38:03 am »
REQUESTS

I used thor for my last project an thought it was great.. I  pretty much only used the animation class though. Anyway.. from that experience.. I would like to suggest 2 things.

1) aniamtion.getFrameNumber(); ---- It would be cool to be able to test witch frame the animation is on at any give refresh for the window. This could be used for a lot of stuff.. say syncing audio ques for example.

2) When adding a animation you use a std::string as the identity key. Would be great if this could be over loaded to also be able to use simple int. Unless I am misunderstanding things (witch is very possible) it was kind of a pain to build animation assignment code as you couldn't use incrementing loops or anything to call the new animations with out using code to add ints to strings and stuff. While a string name is fine for manually calling .. I think using ints, maybe enums for readability would be a better way to go.

Thanks for all your work on this project.. I'll have to have a closer look at what else is in thor.

24
System / Re: SFML 2 Randomizer
« on: June 28, 2012, 06:53:38 am »
std::rand is a bit lame imo... but there is a neat randomiser in boost you can use if you like?

http://www.boost.org/doc/libs/1_49_0/doc/html/boost_random.html

It can do a lot more cool stuff, and I switched to it form my hobby project I am doing outside of school for random map generation. As you can have all sorts of restrictions and properties on the random numbers generated. Coll stuff like probabilities. Like for example, gen 100 numbs (1-100) but 50 of them have to be 5 (5 == tree sprite in my game for example.) but out of those 5 trees X trees are normal, y trees are rare and z trees are super rare and have a wood nymph living in it.. )

25
General / Re: Simple Collision Detection -> SFML2
« on: June 28, 2012, 05:17:40 am »
When you're done with the conversion, will you add it to the wiki?
I ended up not using it. I think I should have, but I couldn't get it to work so wrote my own and it is pretty bad. What I needed was a circle test vs a rectangle.

26
SFML projects / Re: Starfire - Ares Assault released.
« on: June 27, 2012, 04:02:23 pm »
not really. I play a lot of these types of games and this one isn't nearly as hard as some other ones I have played. It is hard to tell after a quick "look see" because these games are often about repetition and learning patterns.. that is how games like Ikaruga are played.. at least for me. I think difficulty is one of teh hardest things to put into a game.. to easy and people hate it to hard and people hate it.. make it good for one set of players and you piss of another set. Also anyone who says "just put in a difficulty setting" knows that this is about as good as putting in a video settings.. everyone wants to play on the hardest with the best gfx.

I think maybe you should look into "ramping" the difficulty more. Start easy and get hard, but go slow so beginners get a good play in and ramp it to super crazy hard.

27
SFML projects / Re: Starfire - Ares Assault released.
« on: June 27, 2012, 03:21:51 pm »
really great work.. I love it!

28
Ok I'm back... well I nvr left.. big thanks to the forum members as well as though foolish enough to respond when I spoke in IRC. I couldn't have done this with out you all.

This is my 2nd ever program I have ever written and I think it came out really well considering. This is a assessment to hand in for marks, and I have 2 other assessments for other subjects due and just have to call it quits here bugs and all.

Still check it out and any comments would be welcome.  I used Thor Animation for all the animations btw.

ArkBreaker (win) v1.1
http://www.mediafire.com/download.php?683czti8p2j2i09

This should be cross platform and I plan to build a Unix (ubuntu) and a Mac version when I get time after my mid term assessments are all done.

Anyway.. bit thanks to those that helped and I'll see you for Assessment 3... witch I already know what it will be... a Pac-Mac clone!

See ya!!
Oh part of the Assignment was to make a rolling demo.. so here it is!

29
General / Re: Simple Collision Detection -> SFML2
« on: June 25, 2012, 10:11:17 am »
so...

float Radius1 = (Object1.GetSize().x + Object1.GetSize().y) / 4;

becomes

float Radius1 = (Object1.getLocalBounds().width + Object1.getLocalBounds().height) / 4;

and...

In SFML 2.0 you now got the class Transform with which you can transform anything and the sprite class has a function getTransform() to get the transform object of the sprite class.
sf::Vector2f point = transform.transformPoint(sprite.getTransform());

is the code you gave the same as this old code?
sf::Vector2f pos = Object.TransformToGlobal(sf::Vector2f(0, 0));

30
General / Simple Collision Detection -> SFML2
« on: June 25, 2012, 04:49:31 am »
ON the wikie is a cool collision tester
https://github.com/SFML/SFML/wiki/SourceSimpleCollisionDetection

but it is not SFML2.. I went to try and update it but some of teh function are not in sfml2 as far as I know.. like "TransformToGlobal" ... is there ea version of that under a new name in sfml2?

TransformToGlobal
GetSize

Dose anyone know the sfml2 alternative to these?

Dose anyone have this code updated for SFML2?

Thanks in advance


Pages: 1 [2] 3 4 ... 6