• What are you working on? V2
    2,001 replies, posted
size==arccos(number) *Prepare for dumb*
[QUOTE=qurl;16958527]They taught programing languages at your school? When I was at school all we did was powerpoint and all the rems played flash games all day :([/QUOTE] Yeah, the first 2 years we learned Java and OOP. In the 3rd year we learned the basics of C and C++ and if we would have had time we would have done C# too. 4th and 5th year we can do either C#, C++ or Java. We also made some flashing LEDs with a micro controller and Assembler in another subject. And we were learning about internal OS stuff and networking (CCNA1) too. And Linux, how to use sed, grep, find and what's in the /home /etc /dev and /proc directories.
[QUOTE=Hypershadsy;16967004]size==arccos(number) *Prepare for dumb*[/QUOTE] [img]http://www.euclideanspace.com/maths/geometry/trig/acos.gif[/img] By basis of the graph, size = (1 + arccos(number * some_constant)) * another_constant Where some_constant you will have to tweak yourself , and same as another_constant. If you give me a numbers for your max size (only 1 asteroid) and minimum size (max asteroid) including numbers for min size and max asteroids I should be able to come up with the formula if you don't know how to do it yourself.
[QUOTE=jA_cOp;16958544]So... do you switch back and forth? What?[/QUOTE] He's basically teaching us C++ without any OOP.
[QUOTE=Mattz333;16968064][img]http://www.euclideanspace.com/maths/geometry/trig/acos.gif[/img] By basis of the graph, size = (1 + arccos(number * some_constant)) * another_constant Where some_constant you will have to tweak yourself , and same as another_constant. If you give me a numbers for your max size (only 1 asteroid) and minimum size (max asteroid) including numbers for min size and max asteroids I should be able to come up with the formula if you don't know how to do it yourself.[/QUOTE] Thanks but I think I was wrong; a function isn't really what I should go with, because I'll end up wanting to tweak it to enhance gameplay anyways. I was thinking of possibly doing something like this: [IMG]http://i429.photobucket.com/albums/qq12/the1trueryandaniels/asteroid_curve2.png[/IMG] Where I would just define how many I want of each size by hand, and just break the up into size groups.
[QUOTE=ryandaniels;16968331]Thanks but I think I was wrong; a function isn't really what I should go with, because I'll end up wanting to tweak it to enhance gameplay anyways. I was thinking of possibly doing something like this: [IMG]http://i429.photobucket.com/albums/qq12/the1trueryandaniels/asteroid_curve2.png[/IMG] Where I would just define how many I want of each size by hand, and just break the up into size groups.[/QUOTE] How about just hard coding it? A switch statement for each number of asteroids and the corrisponding sizes.
[QUOTE=Mattz333;16968395]How about just hard coding it? A switch statement for each number of asteroids and the corrisponding sizes.[/QUOTE] That's actually what I was thinking of doing, but I'm sure the three red x's under your post have something to say about it.
How I would do it, make an array something like this [cpp] int AmountAstroids = {100,90,80,60,40,10,5,2}; Astroid.amount = AmountAstroids[Astroid.getsize]; [/cpp]
what about having a Vector2 of type float (so if you had a vector 2 template it'd be something like Vec2<float>. the point of origin on the graph is 0.0f, 0.0f, with the maximum size of each vector coordinate being 1.0f. The first coordinate denotes the size of the asteroid, so your first asteroid's vector would be a 1.0f, 0.01f. I'm assuming there will never be more than a hundred asteroids. So you slowly work your way down and just decrement a certain amount, for creating new asteroids. A long involved process, but I'm fairly certain it would work out. :v:
[QUOTE=Chandler;16970400]what about having a Vector2 of type float (so if you had a vector 2 template it'd be something like Vec2<float>. the point of origin on the graph is 0.0f, 0.0f, with the maximum size of each vector coordinate being 1.0f. The first coordinate denotes the size of the asteroid, so your first asteroid's vector would be a 1.0f, 0.01f. I'm assuming there will never be more than a hundred asteroids. So you slowly work your way down and just decrement a certain amount, for creating new asteroids. A long involved process, but I'm fairly certain it would work out. :v:[/QUOTE] That's an interesting idea, but I think I'm going to go with something like what zombuster posted. Also, my latest approximation would suggest somewhere around 20,000 asteroids, although I could still get that by simply amplifying your process.
[QUOTE=Ortzinator;16968271]He's basically teaching us C++ without any OOP.[/QUOTE] To clarify, the syllabus not very specific so I really don't know what's going on. The class is "C Programming" which is actually for the electronics engineering program, not computer programming. Also the book is "Ivor Horton's Beginning Visual C++ 2008" but he says the book choice was a last minute thing and it's not the book he wanted for the course. But he's a [url=http://en.wikipedia.org/wiki/Professional_Engineer#United_States]P.E.[/url] who worked at IBM for 15 years so I trust him so far...
[img]http://www.cubeupload.com/files/387000belttest2.gif[/img] Hooray, all the basic, important (iffy) parts are in place. All downhill from here. ...Right? Extra: was going to post this yesterday and forgot; [IMG]http://i429.photobucket.com/albums/qq12/the1trueryandaniels/debugging_pic.png[/IMG] Basically I was just using paint.net to troubleshoot a problem in the chopping code. It has given me some ideas art wise...
[QUOTE=ryandaniels;16973416][img]http://www.cubeupload.com/files/387000belttest2.gif[/img] Hooray, all the basic, important (iffy) parts are in place. All downhill from here. ...Right?.[/QUOTE] Wow, that looks awesome. You should make a Freelancer like Space-Shooter out of this
[QUOTE=Alex22;16973529]Wow, that looks awesome. You should make a Freelancer like Space-Shooter out of this[/QUOTE] All in good time :D I think you'll all be pleased by what I have in store for this, once it reaches it's first public release.
You guys amaze me. I dunno how average people (not in a bad way) on a forum can do such awesome things. I'm impressed =D
[QUOTE=ryandaniels;16966924]Hey, how would I go about making asteroids to fit a graph like this? [IMG]http://i429.photobucket.com/albums/qq12/the1trueryandaniels/asteroid_curve.png[/IMG][/QUOTE] I'd use a graph like -[constant]*x²+[constant]*x³+[constant]. That can be adjusted properly (maybe use higher exponents if you can't get it like you want) and it's easier on the CPU than trigonometry, although the array also looks appealing.
[QUOTE=LasGunz;16978674]You guys amaze me. I dunno how average people (not in a bad way) on a forum can do such awesome things. I'm impressed =D[/QUOTE] Some of us go to uni, some of us are big nerds who sit on a computer all day [img]https://dl.getdropbox.com/u/99765/ui_2.png[/img] Very simple to make and add parts [cpp] button1 = new UI_button(); button1->buttonBorder = textureManager->GetD3DTextureFromTexID(TEXID_UI_BUTTON); button1->buttonBorderOver = textureManager->GetD3DTextureFromTexID(TEXID_UI_BUTTON_OVER); button1->buttonBorderDown = textureManager->GetD3DTextureFromTexID(TEXID_UI_BUTTON_MOUSEDOWN); button1->onClick.AddEventHandler(this, (callback)&UI_testWindow::button1_onClick); button1->SetText("button1"); button1->SetFont(fontManager->GetD3DXFontFromFontID(FONTID_TAHOMA_NORMAL_13)); componentPanel->AddComponent(button1); void UI_testWindow::onResize() { UI_window::onResize(); button1->SetSize(90,25); button1->SetPosition(0, 0); } void UI_testWindow::button1_onClick() { label1->SetText("You clicked the button!"); } [/cpp]
[QUOTE=qurl;16979692] [cpp] button1 = new UI_button(); button1->buttonBorder = textureManager->GetD3DTextureFromTexID(TEXID_UI_BUTTON); button1->buttonBorderOver = textureManager->GetD3DTextureFromTexID(TEXID_UI_BUTTON_OVER); button1->buttonBorderDown = textureManager->GetD3DTextureFromTexID(TEXID_UI_BUTTON_MOUSEDOWN); button1->onClick.AddEventHandler(this, (callback)&UI_testWindow::button1_onClick); button1->SetText("button1"); button1->SetFont(fontManager->GetD3DXFontFromFontID(FONTID_TAHOMA_NORMAL_13)); componentPanel->AddComponent(button1); void UI_testWindow::onResize() { UI_window::onResize(); button1->SetSize(90,25); button1->SetPosition(0, 0); } void UI_testWindow::button1_onClick() { label1->SetText("You clicked the button!"); } [/cpp][/QUOTE] That's cool, how do you manage callbacks? Edit: Are they static methods?
[QUOTE=qurl;16979692]Some of us go to uni, some of us are big nerds who sit on a computer all day[/QUOTE] And others are high-school clubheads who like to work out and program.
[QUOTE=Vampired;16980118]That's cool, how do you manage callbacks? Edit: Are they static methods?[/QUOTE] Not sure, my friend add the callbacks for the button
What do you say about current boss-UI? [IMG]http://i32.tinypic.com/mhcyvb.png[/IMG] I really should make the texts stand more out.
[QUOTE=Sasupoika;16980418]What do you say about current boss-UI? [IMG]http://i32.tinypic.com/mhcyvb.png[/IMG] I really should make the texts stand more out.[/QUOTE] Maybe having a border around it would help.
[QUOTE=nullsquared;16980176]And others are high-school clubheads who like to work out and program.[/QUOTE] And some are just intelligent.
...and we all come together to argue.
no we don't
[IMG]http://i32.tinypic.com/33nyi5x.png[/IMG] Is this better?
-snop-
That's nice and retro looking.
That's nice and retro looking.
That's nice and re-.. Looks nice! Any timeframe on release? :p
Sorry, you need to Log In to post a reply to this thread.