Search:

Type: Posts; User: Kain

Search: Search took 0.00 seconds.

  1. Replies
    15
    Views
    1,880

    I use this code for random numbers, and up until...

    I use this code for random numbers, and up until now it seems to work pretty well. :-)


    #include <ctime>
    #include <cstdlib>
    #include <iostream>
    using namespace std;

    bool random = true;
  2. Replies
    5
    Views
    3,454

    I'm so sorry for the double post, but it seems I...

    I'm so sorry for the double post, but it seems I cannot edit my previous one. :redface:

    So, it seems I made a mistake in my last post. The program was crashing because I forgot to call the...
  3. Replies
    12
    Views
    5,680

    I've been trying all day without even a break to...

    I've been trying all day without even a break to make different functions for horizontal and vertical collision detections, but I can't seem to get it right.

    The best I could come up with is this:...
  4. Replies
    5
    Views
    3,454

    Sorry for the delay, it took me some time to...

    Sorry for the delay, it took me some time to re-write thw code in a readable fashion.
    I'm not familiar with SourceForge yet, though, so I'll upload it here if it's not a problem. :-)

    globals.h
    ...
  5. Replies
    5
    Views
    3,454

    I see what you mean. The only reason I want to...

    I see what you mean. The only reason I want to make an enemy class is that I want to make an enemy editor.

    I made a seperate editor with a seperate map just for enemies, and it seems to work fime,...
  6. Replies
    5
    Views
    3,454

    [SDL] Enemy class inheriting from tile class.

    I'm trying to learn how to make an enemy class inherit from a tile class to use with a level editor that places tiles. However, I'm still very new to programming, and I probably don't know how to use...
  7. Replies
    12
    Views
    5,680

    Thank you so much for the help! I changed... ...

    Thank you so much for the help!
    I changed...


    if( col( box , tiles ) == true )
    {
    y -= jvel;
    box.y = y;

    ...to...
  8. Replies
    12
    Views
    5,680

    I almost solved it without having to divide the...

    I almost solved it without having to divide the collision to horizontal and vertical.
    The only problem now is that sometimes when I jump or fall on tiles, it takes the player about 4 frames to...
  9. Replies
    12
    Views
    5,680

    I knew the solution was something ridiculously...

    I knew the solution was something ridiculously simple! It did not even cross my mind just changing the order of the functions!
    I almost solved it, and now I'm confident I can make it work perfectly...
  10. Replies
    12
    Views
    5,680

    SDL: Character collision with tiles.

    Hello again.

    I'm trying to learn SDL for some time now using LazyFoo's tutorials.

    I'm currently trying to make a very simple platformer with a tile based level, but I can't quite get the...
  11. Thanks for the suggestions everybody. When I...

    Thanks for the suggestions everybody.
    When I find some time I'll try them all, and I'll let you know. :)
    Thanks again. :)
  12. Hey, thanks. Implementing your suggestion I...

    Hey, thanks. Implementing your suggestion I finally found the source of the problem.

    Turns out the timer update loop was outside the "SDL_PollEvent( &event )" loop, when it should be inside it.
    I...
  13. No, it gives nothing. The program works fine...

    No, it gives nothing.
    The program works fine though if I add "printf( SDL_GetError() );" INSTEAD of "return 1;".
    Generally it works fine if I do not have it return anything if Mix_PlayChannel()...
  14. Turns out I can't figure it out it after all. ...

    Turns out I can't figure it out it after all.


    if( Mix_PlayChannel( -1 , up , 0 ) == -1 ){

    return 1;

    }

    For some reason in the program on my previous post, Mix_PlayChannel() gives...
  15. SDL timer program only works when mouse is moving.

    So I'm trying to get a timer program to work using LazyFoo's Tutorial.

    For some reason, though, my timer only works if the mouse is moving or a key is being pressed.

    I downloaded the sample...
  16. Thanks a ton! :D I re-wrote the code correctly...

    Thanks a ton! :D

    I re-wrote the code correctly this time, and now it (sort of) works.
    It has some problem playing the sounds, some times at the first keystroke, other times at the second, but...
  17. SDL program returns 3, debugger gives Segmentation fault

    Hello, I'm new to programming, and I'm trying to learn SDL using (mostly) LazyFoo's tutorials.

    I'm using Code::Blocks in Windows XP, and when trying to run my program, it returns 3. The code is...
Results 1 to 17 of 17