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;
Type: Posts; User: Kain
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;
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...
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:...
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
...
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,...
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...
Thank you so much for the help!
I changed...
if( col( box , tiles ) == true )
{
y -= jvel;
box.y = y;
...to...
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...
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...
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...
Thanks for the suggestions everybody.
When I find some time I'll try them all, and I'll let you know. :)
Thanks again. :)
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...
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()...
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...
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...
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...
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...