• What are you working on? V2
    2,001 replies, posted
For some reason the asteroids slightly (but noticeably) bob up and down as they rotate. Can't figure out why. :argh:
[QUOTE=qurl;16919813]Who cares? That's how most people learn. If he's having fun then why do you care?[/QUOTE] most people learn by stealing other peoples work and calling it their own? what.
Well people certainly don't learn when everybody is discouraging them. Was having timing issues earlier, and had a facepalm moment. Fixed them, so Now the musos stay in sync regardless of direction. [media]http://www.youtube.com/watch?v=PVHggkCGcjA[/media] What I was doing wrong: Getting the frame time for each muso, This meant each one was getting a different distance multiplier :downs: Corner Tiles needed a fix to stop them from misaligning, But I neglected to do the same tweak to the normal tiles to equalise the timing... DOH :downs: I also Implemented: An events driven sort of system for the keyboard input, So now a keymap can be loaded :woop:. No more drawing everything that isn't even onscreen... +56FPS Increase!! :woop:
[QUOTE=ryandaniels;16930371]For some reason the asteroids slightly (but noticeably) bob up and down as they rotate. Can't figure out why. :argh:[/QUOTE] Your physics are so realistic that gravity exists between objects. :v: Perhaps they are resetting their center/local(i.e. 0, 0 on their sprite) coordinate as they spin? Without a video I really can't say.
[QUOTE=Chandler;16931121]Your physics are so realistic that gravity exists between objects. :v: Perhaps they are resetting their center/local(i.e. 0, 0 on their sprite) coordinate as they spin? Without a video I really can't say.[/QUOTE] Funny you should ask that; [img]http://www.cubeupload.com/files/335200bobbingast.gif[/img] I'm baffled. Their centers don't change (0, 0), and that wouldn't really cause this sort of movement anyways.
Rounding errors? an int that should be a float? I say this because My grid has a similar looking problem, not as violent though.
[QUOTE=Tezza1234;16931338]Rounding errors? an int that should be a float? I say this because My grid has a similar looking problem, not as violent though.[/QUOTE] I'm sorta thinking that, but it doesn't really look like it's popping so much as fluently bobbing. If it was rounding errors it would pop instantly from place to place. Also, look at this [img]http://www.cubeupload.com/files/acf800nobob.gif[/img] [editline]05:29PM[/editline] Oh, and that's rotating too.
May I ask, how do you create those gifs?
[QUOTE=Baldr;16931971]May I ask, how do you create those gifs?[/QUOTE] I record as an .avi with with CamStudio and then I pull it up in virtual dub and tell it to export as a .gif [editline]06:13PM[/editline] [code] -1, -3, -5, -8, -10, -13, -15, -17, -19, -21, -23, -24, -25, -26, -26, -25, -25, -24, -22, -20, -18, -16, -14, -12, -9, -7, -4, -2, 0, 0, 1, 2, 3, 3, 2, 2, 0, 0, -2, -4, -6, -8, -11, -13, -16, -18, -20, -22, -23, -24, -25, -26, -26, -25, -24, -23, -22, -20, -18, -16, -13, -11, -8, -6, -4, -2, 0, 1, 2, 2, 3, 3, 2, 1, 0, 0, -2, -4, -7, -9, -12, -14, -16, -19, -21, -22, -24, -25, -25, -26, -26, -25, -24, -23, -21, -19, -17, -15, -12, -10, -8, -5, -3, -1, 0, 1, 2, 3, 3, 3, 2, 1, 0, [/code] It seems to be coming from box2d, for some reason there are slight oscillations occurring around every 1/3 of a second... [editline]06:45PM[/editline] Oh shit it's my chopping code. It chops the asteroids in a way that fucks with box2d I think... [editline]07:26PM[/editline] Nevermind... it spazzes out even when I haven't chopped it... [editline]07:30PM[/editline] -snip- Wasn't that either...
Fiddling with Yahoo BOSS, I love the Yahoo dev network :D
i just started learning c++ an hour or so and so far I have created a program that checks if you know what year it is [img]http://filesmelt.com/downloader/gfg.jpg[/img] [img]http://filesmelt.com/downloader/das3.jpg[/img] it's nothing major or complicated but i had fun making it
[QUOTE=efeX;16930717]most people learn by stealing other peoples work and calling it their own? what.[/QUOTE] Obviously not but this isn't the source engine he's claiming to be his, just a little tutorial. If that gives him a confidence boost then why the hell not? (He didn't even claim the work to be his anyway)
can someone explain functions to me and how they would be of use? right now i'm learning from [url=http://www.cprogramming.com/tutorial/lesson4.html] this tutorial[/url], and that lesson doesn't really make sense to me.
[QUOTE=bobste;16938799]can someone explain functions to me and how they would be of use? right now i'm learning from [url=http://www.cprogramming.com/tutorial/lesson4.html] this tutorial[/url], and that lesson doesn't really make sense to me.[/QUOTE] Functions are one of the cornerstones of any programming language. They make it easier to reuse code. Imagine this: You have a huge piece of code which does a certain thing. Using functions, you would only have to write it once, and then you could use it in other parts of the program. If you didn't use them, you would have to copy paste the code everywhere, which creates inefficient and ugly code (so don't ever do this). Another thing that makes functions great, is that they can collect a lot of code into one place, so you could easily edit the function once and the changes would effect all the different parts.
[QUOTE=qurl;16938767]Obviously not but this isn't the source engine he's claiming to be his, just a little tutorial. If that gives him a confidence boost then why the hell not? (He didn't even claim the work to be his anyway)[/QUOTE] it was more directed towards his previous posts/threads. but lets just stop this pointless argument.
[QUOTE=efeX;16939144]it was more directed towards his previous posts/threads. but lets just stop this pointless argument.[/QUOTE] I wasn't aware we was arguing :raise:
[QUOTE=efeX;16939144]it was more directed towards his previous posts/threads. but lets just stop this pointless argument.[/QUOTE] So you bring up history? Fuck get over it. This is a thread about working on [b]NOW[/b] not months ago. Stop trolling my posts.
[QUOTE=bobste;16938799]can someone explain functions to me and how they would be of use? right now i'm learning from [url=http://www.cprogramming.com/tutorial/lesson4.html] this tutorial[/url], and that lesson doesn't really make sense to me.[/QUOTE] Let's say a function is a book and whatever is in it is the book's content. [code] int main() { cout << "Hello World!" << endl; return 0; } [/code] You should be familiar with that piece of code, now, imagine that instead of the Hello World program you would be making a huge one, that you needed to use various times, copy pasting the code whenever you need it or writing it again would be a total waste of time. Instead, you can create a function that does it for you. [code] void helloworld() // You create the function, our "book" { cout << "Hello World!" << endl; //Write the contents of the "book" } int main() { helloworld(); //Tell the compiler to "read the book" instead of writing the whole content again return 0; } [/code] I don't know if you understood it right but that's about it, of course it's not really smart to use it like that on just one line of code, it's mainly to be used on lines and lines of code you need to use various times and don't want to write it all over and over again. It also leaves the code more readable. If I said anything wrong, please don't kill me, I'm a bit new to C++ too.
When I put in that code I get [code]main.cpp|3|error C2065: 'cout' : undeclared identifier| main.cpp|3|error C2065: 'endl' : undeclared identifier| ||=== Build finished: 2 errors, 0 warnings ===| [/code]
[QUOTE=bobste;16944718]When I put in that code I get [code]main.cpp|3|error C2065: 'cout' : undeclared identifier| main.cpp|3|error C2065: 'endl' : undeclared identifier| ||=== Build finished: 2 errors, 0 warnings ===| [/code][/QUOTE] Change it to std::cout and std::endl, or add 'using namespace std;' above your functions.
[code]main.cpp|3|error C2871: 'std' : a namespace with this name does not exist| main.cpp|6|error C2653: 'std' : is not a class or namespace name| main.cpp|6|error C2065: 'cout' : undeclared identifier| main.cpp|6|error C2653: 'std' : is not a class or namespace name| main.cpp|6|error C2065: 'endl' : undeclared identifier| ||=== Build finished: 5 errors, 0 warnings ===| [/code] this is how I'm typing it out [code] using namespace std; void helloworld() // You create the function, our "book" { std::cout << "Hello World!" << std::endl; //Write the contents of the "book" } int main() { helloworld(); //Tell the compiler to "read the book" instead of writing the whole content again return 0; } [/code]
#include <iostream> Don't use "using namespace std;" either [cpp] #include <iostream> void helloworld() { std::cout << "Hello World!" << std::endl; } int main() { helloworld(); return 0; } [/cpp]
ok, that worked so [code]# int main() { helloworld(); return 0; } [/code] is the function that tells it not to rewrite, but to "read" hello world?
when you put helloworld(); the program does what is inside the function so you can re-use code.
[QUOTE=bobste;16945009]ok, that worked so [code]# int main() { helloworld(); return 0; } [/code] is the function that tells it not to rewrite, but to "read" hello world?[/QUOTE] Yes. It "reads" the helloworld function and executes its contents.
[QUOTE=bobste;16944718]When I put in that code I get [code]main.cpp|3|error C2065: 'cout' : undeclared identifier| main.cpp|3|error C2065: 'endl' : undeclared identifier| ||=== Build finished: 2 errors, 0 warnings ===| [/code][/QUOTE] Didn't work because I didn't write #include <iostream> nor using namespace std; sorry about that, was just trying to explain the function in itself. :P
[b]HEY GUESS WHAT GUYS!!! I FIGURED OUT WHY MY ASTEROIDS WERE BOBBING AROUND IN CIRCLES WHENEVER I ROTATED THEM IT SEEMED THAT MADE A FULL "BOB" EVERY FEW DEGREES.[/b] [highlight]SPECIFICALLY EVERY 6.28 [I]DEGREES[/I][/highlight] /caps
-snip-
[QUOTE=ryandaniels;16949580][b]HEY GUESS WHAT GUYS!!! I FIGURED OUT WHY MY ASTEROIDS WERE BOBBING AROUND IN CIRCLES WHENEVER I ROTATED THEM IT SEEMED THAT MADE A FULL "BOB" EVERY FEW DEGREES.[/b] [highlight]SPECIFICALLY EVERY 6.28 DEGREES[/highlight] /caps[/QUOTE] well did you fix it?
[QUOTE=Juniez;16950403]well did you fix it?[/QUOTE] Yes :D You see, 6.28, in radians, is equal to 360 degrees. See the correlation? I was rotating the point in degrees, when the measurement was really in radians.
Sorry, you need to Log In to post a reply to this thread.