[QUOTE=supersnail11;39126823]Maybe you should start from the basics instead of trying to make a game as your first project.[/QUOTE]
Nah, there is not really anything wrong with making a game if you break it up and just focus on getting that one bit working then go onto the next feature. My biggest problem was probably trying to write my own physics which after 20+ hours I still couldn't get it to work right.
[QUOTE=supersnail11;39128171]Or, you know, Java# (but not J#, that's taken), because it's almost the same syntax.
And I can't see any resemblance of C# in...this:
[code]procedure CalcNormals;
var
i, j, Count: Integer;
l: Single;
Normal: TVector3f;
FaceNormals: array of TVector3f;
begin
SetLength(N, Length(V));
SetLength(FaceNormals, Length(F));
for i := 0 to High(F) do begin
Normal := GetNormal(V[F[i][0]], V[F[i][1]], V[F[i][2]]);
FaceNormals[i] := Normal;
end;
for i := 0 to High(V) do
begin
ZeroMemory(@Normal, SizeOf(Normal));
Count := 0;
for j := 0 to High(F) do
begin
if (F[j][0] = i) or (F[j][1] = i) or (F[j][2] = i) then
begin
Normal[0] := Normal[0] + FaceNormals[j][0];
Normal[1] := Normal[1] + FaceNormals[j][1];
Normal[2] := Normal[2] + FaceNormals[j][2];
Inc(Count);
end;
end;
N[I][0] := -Normal[0] / Count;
N[I][1] := -Normal[1] / Count;
N[I][2] := -Normal[2] / Count;
l := sqrt(N[I][0]*N[I][0] + N[I][1]*N[I][1] + N[I][2]*N[I][2]);
if l <> 0 then
begin
N[I][0] := N[I][0] / l;
N[I][1] := N[I][1] / l;
N[I][2] := N[I][2] / l;
end;
end;
end;[/code][/QUOTE]
Old Delphi (like the one you quoted) is very C-like.
Delphi's object-orientedness is IMHO more cleanly designed than C++'s, much like C#'s. The more modern features like lambdas and generics are more similar to C#'s equivalents than C++'s template atrocities.
[QUOTE=Jawalt;39072785]Anyone here use Ruby? I've been messing around with it for the last day or so and it's pretty nice. The grammar is.... quirky though. I've yet to see a good guide that will tell me about the grammar, and I don't feel like reading the BNF. It's weird because I am totally not sure where newlines have to go and where parenthesis are allowed to be dropped, and none of the guides address this.[/QUOTE]
I found this just before. It's an excellent Ruby reference:
[url]http://ruby.runpaint.org/[/url]
Been having some fun with the Python imaging library.
[img]http://i.imgur.com/z6ezq.png[/img]
[url]http://pastebin.com/x4wrVvaf[/url]
Garry can you take a quick look at the SFML renderer and sample for Gwen? Converting it to the newest sfml code is pretty easy, everything is now lowercase and GetWidth()/Height has been replaced with getSize().x/y.
I'm having trouble getting it to compile. I get literally 2835 linker errors.
Has anyone else gotten it to compile?
I think it was made for the latest SFML?
Is the latest SFML still in beta? Or is it released properly yet?
He changed it a bit, like the lowercase "everything", then did a release candidate. So it's basically released.
[QUOTE=Topgamer7;39127469]I'm pretty sure you can sell successful bot nets for millions. Although if you can find a 0day, you can sell that for large chunks of cash too. If you can managed to find a good one, like one for win7. The os not any of the programs people install.[/QUOTE]
Millions? Everybody knows the only way to make that much is by hacking the Gibson.
[QUOTE=AtomiCasd;39128723]He changed it a bit, like the lowercase "everything", then did a release candidate. So it's basically released.[/QUOTE]
Ok I'll try to find time to make it compatible, unless anyone forks and manages to do it before me.
[QUOTE=Sartek;39128266]Nah, there is not really anything wrong with making a game if you break it up and just focus on getting that one bit working then go onto the next feature. My biggest problem was probably trying to write my own physics which after 20+ hours I still couldn't get it to work right.[/QUOTE]
It would probably be easier if um, you knew the basics...
[QUOTE=cody8295;39128769]It would probably be easier if um, you knew the basics...[/QUOTE]
And the finished product wouldn't be a huge pile of spaghetti.
Yeah I see what you guys are getting at, but I ended up learning the basics from trying to make a game.
Anyway just been working on merging my 2 game engines features and intergrating Box2D for the physics, Not much to show at the moment but should probably have it all finished in a couple hours.
[QUOTE=Mega1mpact;39128140][img]http://i.imgur.com/joKaO.png[/img]
It's used in some programming languages. The only one I can think of right now is Python. It's not that usefull unless you're doing stuff like formatting SQL output into a fancy ascii table etc as far as I know.[/QUOTE]
Ruby, too.
[QUOTE=garry;39128763]Ok I'll try to find time to make it compatible, unless anyone forks and manages to do it before me.[/QUOTE]
Too slow :)
Yay, started learning C++!
[IMG]http://puu.sh/1KNm5[/IMG]
It's a yahtzee roller.
I guess it could be more optimized but hey, it's my first proper program.
[code]
#include <iostream>
#include <Windows.h>
#include <cstdlib>
#include <ctime>
int RandomInt(int min, int max)
{
int r = rand()%max+min;
return r;
}
int main() {
srand(time(0));
std::cout << "Welcome to Yahtzee rolling machine!" << std::endl << "Press enter to roll a yahtzee!" << std::endl;
std::cin.get();
bool found = false;
const int numDice = 6;
int dice[numDice];
int rolls = 0;
while(found==false) {
rolls++;
for(int i = 1;i<=numDice;i++) {
dice[i] = RandomInt(1,6);
std::cout << dice[i] << " ";
}
std::cout << std::endl;
bool areEqual = true;
int lastNum = dice[1];
for(int i = 2;i<=numDice;i++) {
if(dice[i]!=lastNum) {
areEqual = false;
}
lastNum = dice[i];
}
if(areEqual==true) {
found = true;
}
}
std::cout << "You rolled a yahtzee!" << std::endl << "It took you " << rolls << " rolls!" << std::endl;
return 0;
}
[/code]
You could combine the roll and the check into one if you wanted:
[cpp]found = true;
int last = 0;
for(int i = 1;i<=numDice;i++) {
int num = RandomInt(1, 6);
std::cout << num << " ";
if (last && num != last)
found = false;
last = num;
}[/cpp]
[IMG]http://puu.sh/1KNUd[/IMG]
Woo! At least! I figured out how to write the keyboard driver!
I'm mapping the keyboard scan codes to characters right now, ESC key and numbers 0,1-9 are done.
[IMG]http://puu.sh/1KNZJ[/IMG]
Also i'm doing it this way because i can press ~8 buttons at once and it scans them correctly.
[QUOTE=Mega1mpact;39128456]Been having some fun with the Python imaging library.
[IMG]http://i.imgur.com/z6ezq.png[/IMG]
[URL]http://pastebin.com/x4wrVvaf[/URL][/QUOTE]
I swear I've seen this somewhere else.. :v:
[QUOTE=FlashStock;39130144]I swear I've seen this somewhere else.. :v:[/QUOTE]
Looks pretty similar to my Twitter background, but I don't remember where I got that from.
[IMG_THUMB]https://twimg0-a.akamaihd.net/profile_background_images/83071723/squares.jpg[/IMG_THUMB]
[QUOTE=Z_guy;39130255]Looks pretty similar to my Twitter background, but I don't remember where I got that from.
[IMG_THUMB]https://twimg0-a.akamaihd.net/profile_background_images/83071723/squares.jpg[/IMG_THUMB][/QUOTE]
Yeah that's my desktop background, too
Any idea why I am getting these errors?
[CODE]
8|error: expected unqualified-id before ')' token|
9|error: expected class-name before '(' token|
6|error: an anonymous struct cannot have function members|
24|error: abstract declarator '<anonymous class>' used as declaration|
[/CODE]
[CODE]
#ifndef MouseWrapper
#define MouseWrapper
#include <SFML/Window/Mouse.hpp>
class MouseWrapper
{
public:
MouseWrapper();
~MouseWrapper();
int X();
int Y();
bool left();
bool lastleft();
bool right();
bool lastright();
void Update();
private:
int x;
int y;
bool LEFT;
bool LLEFT;
bool RIGHT;
bool LRIGHT;
};
#endif // MouseWrapper
[/CODE]
[QUOTE=FlashStock;39130273]Yeah that's my desktop background, too[/QUOTE]
LOL! It's my wallpaper, too!
Also i have a similar one on my tablet.
[QUOTE=FlashStock;39130144]I swear I've seen this somewhere else.. :v:[/QUOTE]
It's a commonly used wallpaper for random stuff. I tried finding the original author a couple of times with no success. I like the style so I made a generator for it :3.
Example: [url]http://i.imgur.com/OFIxM.jpg[/url] (I did not make that image)
[QUOTE=Sartek;39130323]Any idea why I am getting these errors?
[CODE]
8|error: expected unqualified-id before ')' token|
9|error: expected class-name before '(' token|
6|error: an anonymous struct cannot have function members|
24|error: abstract declarator '<anonymous class>' used as declaration|
[/CODE]
[CODE]
...
#include <SFML/Window/Mouse.hpp>
...
[/CODE][/QUOTE]
Try:
[code]
#include "SFML/Window/Mouse.hpp"
[/code]
Also, you probably want to post in the "[url=http://www.facepunch.com/showthread.php?t=1167392]What do you need help with?[/url]" thread.
[QUOTE=Robbis_1;39130415]Try:
[code]
#include "SFML/Window/Mouse.hpp"
[/code]
Also, you probably want to post in the "[url=http://www.facepunch.com/showthread.php?t=1167392]What do you need help with?[/url]" thread.[/QUOTE]
That diddn't work.
Will post it in there now forgot about that thread.
[QUOTE=Sartek;39130323]Any idea why I am getting these errors?
[CODE]
8|error: expected unqualified-id before ')' token|
9|error: expected class-name before '(' token|
6|error: an anonymous struct cannot have function members|
24|error: abstract declarator '<anonymous class>' used as declaration|
[/CODE]
[CODE]
#ifndef MouseWrapper
#define MouseWrapper
#include <SFML/Window/Mouse.hpp>
class MouseWrapper
{
public:
MouseWrapper();
~MouseWrapper();
int X();
int Y();
bool left();
bool lastleft();
bool right();
bool lastright();
void Update();
private:
int x;
int y;
bool LEFT;
bool LLEFT;
bool RIGHT;
bool LRIGHT;
};
#endif // MouseWrapper
[/CODE][/QUOTE]
You've defined the token "MouseWrapper" to be an empty string, so the preprocessor sees it and replaces it with it. Your declaration ends up as:
[cpp]
class
{
public:
();
~();
int X();
int Y();
bool left();
bool lastleft();
bool right();
bool lastright();
void Update();
private:
int x;
int y;
bool LEFT;
bool LLEFT;
bool RIGHT;
bool LRIGHT;
};
[/cpp]
This is why you usually use the header guards as an all uppercase thing, some weird-ass hash, or something like MouseWrapper_h or MOUSEWRAPPER_HPP.
Or use #pragma once because the compilers out there that don't support it barely follow any c++ standard to begin with (I'M LOOKING AT YOU SUN STUDIO. YOU ARE A BLIGHT UPON THIS PLANET AND MY INNOCENCE. MAY YOUR MAINTAINERS SUFFER A THOUSAND WAILING DEATHS AT THE HAND OF KEVIN J. ANDERSON. IT IS A FATE WORSE THAN DEATH.)
[QUOTE=cartman300;39130130]
Woo! At least! I figured out how to write the keyboard driver!
I'm mapping the keyboard scan codes to characters right now, ESC key and numbers 0,1-9 are done.
[IMG]http://puu.sh/1KNZJ[/IMG]
Also i'm doing it this way because i can press ~8 buttons at once and it scans them correctly.[/QUOTE]
Scancode.ToString reminds me of things like if (somebool.ToString.Length == 4) {true} else {false}.
You can't use switch with numbers? O_o
[QUOTE=Chandler;39130604]You've defined the token "MouseWrapper" to be an empty string, so the preprocessor sees it and replaces it with it. Your declaration ends up as:
[cpp]
class
{
public:
();
~();
int X();
int Y();
bool left();
bool lastleft();
bool right();
bool lastright();
void Update();
private:
int x;
int y;
bool LEFT;
bool LLEFT;
bool RIGHT;
bool LRIGHT;
};
[/cpp]
This is why you usually use the header guards as an all uppercase thing, some weird-ass hash, or something like MouseWrapper_h or MOUSEWRAPPER_HPP.
Or use #pragma once because the compilers out there that don't support it barely follow any c++ standard to begin with (I'M LOOKING AT YOU SUN STUDIO. YOU ARE A BLIGHT UPON THIS PLANET AND MY INNOCENCE. MAY YOUR MAINTAINERS SUFFER A THOUSAND WAILING DEATHS AT THE HAND OF KEVIN J. ANDERSON. IT IS A FATE WORSE THAN DEATH.)[/QUOTE]
Thanks, Normally I do do it all in uppercase but I had to change the define from MOUSE to MouseWrapper due to a naming clash.
Edit: Let me rephrase that Originally the class was called Mouse with the define as MOUSE but I renamed the class to MouseWrapper and accidentally didn't do the define in uppercase.
[QUOTE=Sartek;39130945]Thanks, Normally I do do it all in uppercase but I had to change the define from MOUSE to MouseWrapper due to a naming clash.[/QUOTE]
define the filename in allcaps with . replaced by _
Sorry, you need to Log In to post a reply to this thread.