Search found 76 matches

by PaperDuckyFTW
Sat Oct 09, 2010 8:38 pm
Forum: Game Development
Topic: 2D Dynamic Lighting Tutorial
Replies: 27
Views: 42179

Re: 2D Dynamic Lighting Tutorial

pythagorean theorem + trig are used a shitload in graphics programming especially, though game programming in general is definitely where it is prominent.
Ive used trig back when playing with game maker's 3D support but 2d lighting is much, much cooler.
by PaperDuckyFTW
Sat Oct 09, 2010 1:34 pm
Forum: Game Development
Topic: 2D Dynamic Lighting Tutorial
Replies: 27
Views: 42179

Re: 2D Dynamic Lighting Tutorial

WOW I was think it would be cool to include lighting into my current/future games and I thought the only way I could was with OpenGL. THANKYOU SO MUCH!! Now I can actually find a use for learning pythagorus's theorum and trigonometry. The next time someone says "When will we ever need to know t...
by PaperDuckyFTW
Fri Oct 08, 2010 7:26 am
Forum: Programming Discussion
Topic: If you have time, help with code ?
Replies: 14
Views: 1243

Re: If you have time, help with code ?

Both of you are right, and i totally agree with you. After playing with Qt for a bit, i understood why there was parameters in the main function so I have a basic understanding of what it means however im not too fussed as of now learning how to use them. From memory Qt uses it for managing the wind...
by PaperDuckyFTW
Tue Oct 05, 2010 1:08 pm
Forum: Programming Discussion
Topic: If you have time, help with code ?
Replies: 14
Views: 1243

Re: If you have time, help with code ?

/facepalm, /chicken, /imadumbass In the main funtion, when you initialse/declare it, you're meant to have (int argc, char* args[] ) However I forgot to have that at all, because for the past month i havnt been using SDL so havn;t needed nything other then main() Thanks everyone for your help. Meanwh...
by PaperDuckyFTW
Mon Oct 04, 2010 9:50 pm
Forum: Programming Discussion
Topic: If you have time, help with code ?
Replies: 14
Views: 1243

Re: If you have time, help with code ?

I know about the .cpp include rule and so all I've done is included the .h files Ive played around with it, and decided to just put everything in a .h file instead of having a .cpp file for each header. Now its giving me: error LNK2019: unresolved external symbol _SDL_main referenced in function _ma...
by PaperDuckyFTW
Mon Oct 04, 2010 7:41 pm
Forum: Programming Discussion
Topic: If you have time, help with code ?
Replies: 14
Views: 1243

Re: If you have time, help with code ?

Thanks for your reply, but it didnt work :evil: I made all the bothersome variables into extern variables, then made a .cpp file where I declared them as usual however it still gives me the same errors. Just from, curiosity, why does MSVC++ make a .obj files anyway? I've looked through them and it l...
by PaperDuckyFTW
Mon Oct 04, 2010 10:17 am
Forum: Programming Discussion
Topic: If you have time, help with code ?
Replies: 14
Views: 1243

Re: If you have time, help with code ?

Thankyou very much for your help, as expected it worked :D This is more proof I gotsta go back to learning the more advanced c++ that i skipped out on. However, now MSVC++ is spewing out a ton of errors saying things like: "unions SDL_Event event already defined in main.obj; second definition i...
by PaperDuckyFTW
Mon Oct 04, 2010 8:39 am
Forum: Programming Discussion
Topic: If you have time, help with code ?
Replies: 14
Views: 1243

If you have time, help with code ?

Heeya, I guess out of fun primarily, I'm working on a Level class to load and draw the levels of a game. I've hit a problem with the code and just thought someone here will definately know the answer so here's the problematic pile of ass: Level::Level(int htn, int vtn, const string &filename){ M...
by PaperDuckyFTW
Tue Aug 10, 2010 4:32 am
Forum: Programming Discussion
Topic: Loading tiles from a file
Replies: 24
Views: 2482

Re: Loading tiles from a file

YESSSSSS!!!!!!!!!!!!!!!!!!!! Okay i am estatic but also feel like smashing my face agsint a wall. Im soo terribly sorry for wasting all of your time. The problem wasnt loading or drawing the tiles. The problem was HOW the tiles were loaded. It was reading the file, but there wasnt any breaks in it: ...
by PaperDuckyFTW
Mon Aug 09, 2010 5:25 am
Forum: Programming Discussion
Topic: Loading tiles from a file
Replies: 24
Views: 2482

Re: Loading tiles from a file

i really have no ideae whats going on. Here is part of my level file: It doesnt matter if I have it filled with 0's, 2's or 1's, its just not reading anything. 200000000000000000000000000002 222222000000000001122222222222 222222222222222222222222222222 222222222222222222222222222222 2222222222222222...
by PaperDuckyFTW
Sun Aug 08, 2010 11:29 pm
Forum: Programming Discussion
Topic: Loading tiles from a file
Replies: 24
Views: 2482

Re: Loading tiles from a file

Thoughout this issue, I have printed the array into the console to see if it was working correctly. Even though the file is completely filled with '2's, the output to the console just reads '0'. I can post a screenshot if its needed. At the moment, these are my loading and drawing functions. The loa...
by PaperDuckyFTW
Sun Aug 08, 2010 6:59 pm
Forum: Programming Discussion
Topic: Loading tiles from a file
Replies: 24
Views: 2482

Re: Loading tiles from a file

*sigh of relief* I can now say i FULLY understand why it wasnt working. It reads the file all as '0', so I can draw tiles with the tile sprite allocated to tile number 0. However it doesnt read any other number. That was why it wasnt working. Anyone know why its not reading any number other then 0? ...
by PaperDuckyFTW
Sun Aug 08, 2010 6:25 am
Forum: Programming Discussion
Topic: Loading tiles from a file
Replies: 24
Views: 2482

Re: Loading tiles from a file

Oh i understand. Would i need to do anything other than for( int x = 0; x < 40; x++ ) { for( int y = 0; y < 30; y++ ) { file >> temp; map[y][x].id = temp; cout<<temp; //so for example, if the txt file has a 0 in it //will it set the map[y][x].id to 0? } } Then //if the array has a '0' in it if( map[...
by PaperDuckyFTW
Sun Aug 08, 2010 1:05 am
Forum: Programming Discussion
Topic: Loading tiles from a file
Replies: 24
Views: 2482

Re: Loading tiles from a file

I now know whats been cocking up. I feel incredibly stupid, but i wasnt drawing the tile whenever the file saw its respective number. I was just filling the screen with the tile :oops: My new question is: in the LoadLevel function, it opens and reads the file perfectly fine, no issues there. How can...
by PaperDuckyFTW
Sun Aug 08, 2010 12:58 am
Forum: Programming Discussion
Topic: Loading tiles from a file
Replies: 24
Views: 2482

Re: Loading tiles from a file

the errors were with the compiler, it wasnt from my code. Changing a compiler option removed the error. This is the tile system: struct CTile { int id; //refers to a SDL_Rect of a tile sheet bool solid; //test to see if you can walk through or not }; //instance of the tile struct, 40 tiles horinzont...