This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#26 2010-04-26 21:47:39

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: YAY YAY YAY C#! :p

Sperry wrote:

fanofcena wrote:

All teh best learning C# its really an awesome programming language i must say , btw as u are a good game maker so i guess u should download XNA development kit thats a really worthy addition to C# that will also enable you to build a X-box game  smile .

btw here is ma first program not at C# but at C++

Code:

#include<iostream.h>

void main()
{ cout<<"hello";
  }

it bugged cuz i fogot to enter getch in it  tongue  .  big_smile

Hmm.. that is bugged, how about:

Code:

#include<iostream.h>

void main()
{
std::cout<<"hello";
}

OR

Code:

#include<iostream.h>
using namespace std;

void main()
{
cout<<"hello";
}

I fixed the bugs!  big_smile

You both are wrong.

This is how to do it:

Code:

#include <iostream>
 
int main()
{
   std::cout << "Hello, world!";
   return 0;
}

OR

Code:

#include <iostream>
using namespace std;

int main()
{
   cout << "Hello, world!";
   return 0;
}

Three things:
• Don't put .h at the end of an #include statement
• It's int not void
• You forgot to put in an exit code

Last edited by ThePCKid (2010-04-26 21:55:47)

Offline

 

#27 2010-04-26 23:04:41

fireball123
Scratcher
Registered: 2008-05-08
Posts: 1000+

Re: YAY YAY YAY C#! :p

wow, and I'm still learning flash


I did it for the Lolz

Offline

 

#28 2010-04-27 02:23:54

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: YAY YAY YAY C#! :p

Sperry wrote:

fanofcena wrote:

All teh best learning C# its really an awesome programming language i must say , btw as u are a good game maker so i guess u should download XNA development kit thats a really worthy addition to C# that will also enable you to build a X-box game  smile .

btw here is ma first program not at C# but at C++

Code:

#include<iostream.h>

void main()
{ cout<<"hello";
  }

it bugged cuz i fogot to enter getch in it  tongue  .  big_smile

Hmm.. that is bugged, how about:

Code:

#include<iostream.h>

void main()
{
std::cout<<"hello";
}

OR

Code:

#include<iostream.h>
using namespace std;

void main()
{
cout<<"hello";
}

I fixed the bugs!  big_smile

LMAO it aint needed
it jst needed

Code:

#include <iostream.h>
#include <conio.h>

void main()
{ cout<<"Hello";
  getch();
}

Actually i was using TC 3.1 so scope operator wasnt needed  tongue  and the bug was that it was tooooooooooooooooooooooooooooooooooooooooooooooooo fast  tongue  it started and closed instantly and we thought it didnt run  tongue  btw u wanna see some cool codes jst buzz me i am making some C++ games right now , Jst wanted to ask can C++ functions run on C# ( i nvr tried but i think they should).


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#29 2010-04-27 02:28:27

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: YAY YAY YAY C#! :p

ThePCKid wrote:

[removed cuz i dont like copying]
This is how to do it:

Code:

#include <iostream>
 
int main()
{
   std::cout << "Hello, world!";
   return 0;
}

OR

Code:

#include <iostream>
using namespace std;

int main()
{
   cout << "Hello, world!";
   return 0;
}

Three things:
• Don't put .h at the end of an #include statement
• It's int not void
• You forgot to put in an exit code

Hmm
1. Well thats a bit confusing its actually compiler dependent some needs .h , .c , .cpp extension , but some as VC 2008 dont need it  big_smile
2. The main statement can be VOID it is again dependent of Compiler TC3.1 supports a    void type main
3. if there is void type statement there is no need for return ;  tongue

Let me show you what i am working on At the moment

Rhy Racer || Complete Jst file Handling is left ||

Code:

//This is Source code in C++ for Rhy's Line Racer//

//Header files . (these are the basic thing that tell the computer what to do)
#include<iostream.h> // For basic In and out funcions
#include<graphics.h> // For Graphics
#include<Math.h> // for mathematical functions
#include<conio.h>// for keyboard Initialisation
#include<dos.h> // For MSDOS functions
#include<stdlib.h>//For some basic functions
#include<stdio.h>//
//Basic Functions(could be termed as scratch blocks) and Strutures( group of variables for an object)
// Coor declares a coordinate in 3 dimensions
struct coor{
int x;
int y;
int z;
};
//coor_xy is teh coordinate in 2 dimensions
struct coor_xy{
int x;
int y;
};

inline char keystroke()       // To check if a key is pressed and if pressed which one is pressed
{
    if(kbhit())
    {return getche();
    }
    else
    return 0;
}
inline coor_xy PntPos(coor P,coor Cam,int xrot,int yrot,int zrot,int f_len)  // The rhy's Gale1.2a programming this is how it looks in C++
{  int xy=(P.y*(cos(yrot))-P.z*(sin(yrot)));
   int xz=(P.y*(sin(yrot))+P.z*(cos(yrot)));
   int yz=(xz*(cos(xrot))-P.x*(sin(xrot)));
   int yx=(xz*(sin(xrot))+P.x*(cos(xrot)));
   int zx=(yx*(cos(zrot))-xy*(sin(zrot)));
   int zy=(yx*(sin(zrot))+xy*(cos(zrot)));
   int SFR=(f_len/f_len+yz+P.z+Cam.z);
   coor_xy ret;
   ret.x=(zx+P.x-Cam.x)*SFR;
   ret.y=(zy+P.y-Cam.y)*SFR;
   return ret;
}
inline int dist(coor P,coor Cam) // To find distance of 2 points I will use Draw distance
{ return sqrt(((P.x-Cam.x)*(P.x-Cam.x))+((P.y-Cam.y)*(P.y-Cam.y))+((P.z-Cam.z)*(P.z-Cam.z)));
}

void main() // This is the main thing that runs ie the When Flag clicked this thing runs :D though u can only have 1 main
{      coor Camera;     // Here is the declration of a coordinate camera
        //Lets initialise our camera at the starting position
        Camera.x=-100;
        Camera.y=0;
        Camera.z=-200;
           // The focal length
    int focallength = 10;
       fstream fin;
       fin::open("c:/autoexec.dat");



// INITIALISATION OF GRAPHIC DRIVERS
    /* request auto detection */
    int gdriver = DETECT, gmode, errorcode;
    int midx, midy, i;

/* initialize graphics, local variables*/
    initgraph(&gdriver, &gmode, "");

/* read result of initialization */
    errorcode = graphresult();
    if (errorcode != grOk)  /* an error
    occurred */
    {
    printf("Graphics error: %s\n", grapherrormsg(errorcode));
    printf("Press any key to halt:");
    getch();
    exit(1); /* terminate with error code */
    }
    char game ='y';    // a variable of type character that tells if the game loop has to be run or not
        do{ settextstyle(GOTHIC_FONT,0,5);   // This sets the text style to Gothic Font with size 5 and Horizontal typing
             for(float i=0;i<30;i+=5)// A loop that runs 6 times
                {
                     cleardevice();// the clear button
                     setbkcolor(GREEN);//sets background color to green
                     setcolor(i);// sets Pen color to variable value i
                     outtextxy(100,200,"Credits to Rhy & BWOG");
                     delay(400);// Halts the screen for 400 miliseconds
                }
            cleardevice();
            settextstyle(SANS_SERIF_FONT,0,20);
            outtextxy(190,140,"DG");
            settextstyle(SANS_SERIF_FONT,0,5);
            outtextxy(190,260,"Games");
            delay(900);
            cleardevice();
            settextstyle(0,0,6);
            setbkcolor(BLACK);
            setcolor(GREEN);
            outtextxy(10,10,"Line Racing");
            getch();
            settextstyle(0,0,2);
            outtextxy(0,180,"To Begin race press key");
            outtextxy(0,220," no options so far");
            getch(); // Halts the screen to the menu
            char RACE='t'; // Declares and sets a variable RACE to t which tells the Computer that race is going on

            coor Map[100];// Here is your map space  a list which contains 3 coordinate per element :D
            float Vel,Theta; // Variables for our car
            do
            {       cleardevice();//This gives us a fresh screen to paint
                for(int i=1;i<=100;i++)// Prints the MAP ALL AS WHOLE MUWHAHAHA C++ HAS NO PROBLEM PASTING THE WHOLE 100Point map its too mere for it :p
                {
                    lineto(PntPos(Map[i],Camera,0,0,0,focallength).x,PntPos(Map[i],Camera,0,0,0,focallength).y);// This function draws line from current point to the given point
                }
            char k = keystroke();   // sets a character variable keystroke to the keypressed
            if(k=='w') // Accelerates your car
            { if(Vel<12)
                Vel=Vel+1;
            }
            else if(k=='s')  // Brakes!!!!!!
            { if(Vel>0);
                Vel=Vel-1;
            }
            if(k=='a') // here we built the steering wheel though i think of using mouse rather then keyboard for directional control
            {     Theta = Theta+10/Vel;
            }
            else if(k=='d')
            {     Theta = Theta - 10/Vel;
            }
            if(k=='q')
            {     exit(1);// this means if Q is pressed the program will exit
            }

             // The following code tells the car to move
            Camera.x= Camera.x+Vel*cos(Theta);
            Camera.y= Camera.y+Vel*sin(Theta);
            delay(2);
 }while(RACE == 't');
    cleardevice();
    outtext("Do u want to Quit(y/n)");
    char ch= getche(); // Sets Game to N when the race is done and U want to quit;
      if(ch!='y'&&ch!='n')
      { do
        {    cleardevice();
            outtext("Do u want to Quit(y/n)");
            ch= getche();
        }while(ch=='y'&&ch=='n');
      }
      else
      game=ch;
}while(game=='y'); // Runs the loop till game =  Y

}

DG games GALEROIT ENGINE : an engine that supports both 3d and 2d graphics but at VGA
its the unfinished Galeroit.cpp

Code:

#include<iostream.h>
#include<conio.h>
#include<graphics.h>


//////////////////////////////////////////////////////////////////////////////
//Take it as a gift or a default directory for writing files on Roit Engine  /
//The only engine that can handle both 2d and 3d Data :D                     /
//Coder : Abhishek Hingnikar AKA fanofcena AKA Dark                          /
//Version: 0.1 Alpha                                                         /
//For Game : ACID TOXIC SURVIVAL
//Basic idea for writing this is to make it easier to depute the whole game
//into small basic parts or structures so that it becomes easy for someone else
//to understand                                             /
//////////////////////////////////////////////////////////////////////////////

struct coor{
         int x;
         int y;
         int z;
};
struct coorXY
{            int x;
         int y;
};
struct image{
         coorXY points[400];
         int color[400];
};
struct sprite2D{
         image Costume[10];
         coorXY Position;
         int Direction;

};

struct trngle{
         coor Points[3];
         int Color;
};

struct ANGLE3D
{ int xy;
  int yz;
  int xz;
};
struct Organ{

         trngle Polys[200];
         coor Position;
         ANGLE3D Angle;
};


Struct Body_Human{
         int Dress;
         Organ LeftHandHi;
         Organ LeftHandLo;
         Organ RightHandHi;
         Organ RightHandLo;
         Organ Head;
         Organ Midsection;
         Organ LeftLegHi;
         Organ LeftLegLo;
         Organ RightLegHi;
         Organ RightLegLo;
         Organ Pelvis;
         Organ Weapon;
         coor  Position;
         ANGLE3D angel;

};


inline void Key(int &key)
{ if(kbhit())
  key = getche();
  else
  key = 0;
}

// GALE 3D 1.2a By RHY : THIS IS WHAT MAKES RENDERING POSSIBLE

inline coor_xy PntPos(coor P,coor Cam,int xrot,int yrot,int zrot,int f_len) 
{  int xy=(P.y*(cos(yrot))-P.z*(sin(yrot)));
   int xz=(P.y*(sin(yrot))+P.z*(cos(yrot)));
   int yz=(xz*(cos(xrot))-P.x*(sin(xrot)));
   int yx=(xz*(sin(xrot))+P.x*(cos(xrot)));
   int zx=(yx*(cos(zrot))-xy*(sin(zrot)));
   int zy=(yx*(sin(zrot))+xy*(cos(zrot)));
   int SFR=(f_len/f_len+yz+P.z+Cam.z);
   coor_xy ret;
   ret.x=(zx+P.x-Cam.x)*SFR;
   ret.y=(zy+P.y-Cam.y)*SFR;
   return ret;
}





// Basic functions and structures for the Game

struct Humaniod{// this can be used for both Cyborgs and Humans :P
char Name[10];
Body_Hisbody hisbody;
int weps[3];
int Ammunation[3][3];
int Health;
}

This runs seemless on TC 3.1 due to graphics.h file  big_smile

Last edited by fanofcena (2010-04-27 02:42:43)


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#30 2010-04-27 04:12:45

Phi_Lho
Scratcher
Registered: 2010-03-22
Posts: 75

Re: YAY YAY YAY C#! :p

urhungry wrote:

Cool! If I had windows I would use c++ or c#, but I don't.

C++ works on all systems, including Macs if that's what you have. Look for Gnu Compiler for example.
C# can work on Unix-like systems, AFAIK, look for Mono, which is a project to make C# working in a portable way.


http://i241.photobucket.com/albums/ff159/PhiLho/KM150.pnghttp://i241.photobucket.com/albums/ff159/PhiLho/PhiLhoLogo.png

Offline

 

#31 2010-04-27 04:21:30

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: YAY YAY YAY C#! :p

Phi_Lho wrote:

urhungry wrote:

Cool! If I had windows I would use c++ or c#, but I don't.

C++ works on all systems, including Macs if that's what you have. Look for Gnu Compiler for example.
C# can work on Unix-like systems, AFAIK, look for Mono, which is a project to make C# working in a portable way.

Tru that C++ Works on any System jst the compiled format changes


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#32 2010-04-27 08:22:02

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: YAY YAY YAY C#! :p

ThePCKid wrote:

meew0 wrote:

I've got MS VisualStudio 2010 Professional. That's the best version you can introduce  smile

Lucky. I only have these Visual Studio programs installed:

• Visual Basic 2008
• Visual C# 2010

The professional or the express version?

I can't remember how I could get the professional version without any buying.  sad


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#33 2010-04-27 14:46:03

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: YAY YAY YAY C#! :p

urhungry wrote:

Cool! If I had windows I would use c++ or c#, but I don't.

Try mono!
Mono-project

meew0 wrote:

ThePCKid wrote:

meew0 wrote:

I've got MS VisualStudio 2010 Professional. That's the best version you can introduce  smile

Lucky. I only have these Visual Studio programs installed:

• Visual Basic 2008
• Visual C# 2010

The professional or the express version?

I can't remember how I could get the professional version without any buying.  sad

Hmmm... i have an idea of how, but Im fine with just the express edition.

I have
VB 2008 Express edition
VC++ 2008 Express edition (With Dark GDK plugin)
VC# 2008 Express edition coupled with the XNA Game Studio plugin.

Dark GDK (Allows for 2D and 3D games easily.)
XNA Game Studio (Allows for you to make games for the PC and the XBOX 360 (Only if you pay about $200 a year though.)

Last edited by markyparky56 (2010-04-27 14:53:59)


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#34 2010-04-27 15:10:25

Cnor
Scratcher
Registered: 2010-01-29
Posts: 1000+

Re: YAY YAY YAY C#! :p

How much did it cost?


See that post up there ^^^
That post was done by me  wink

Offline

 

#35 2010-04-27 15:13:58

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: YAY YAY YAY C#! :p

Cnor wrote:

How much did it cost?

Express editions are free.
http://www.microsoft.com/express/Downloads/


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#36 2010-04-27 17:23:08

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: YAY YAY YAY C#! :p

meew0 wrote:

ThePCKid wrote:

meew0 wrote:

I've got MS VisualStudio 2010 Professional. That's the best version you can introduce  smile

Lucky. I only have these Visual Studio programs installed:

• Visual Basic 2008
• Visual C# 2010

The professional or the express version?

I can't remember how I could get the professional version without any buying.  sad

Express  smile

Offline

 

#37 2010-04-27 17:26:09

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: YAY YAY YAY C#! :p

fanofcena wrote:

ThePCKid wrote:

[removed cuz i dont like copying]
This is how to do it:

Code:

#include <iostream>
 
int main()
{
   std::cout << "Hello, world!";
   return 0;
}

OR

Code:

#include <iostream>
using namespace std;

int main()
{
   cout << "Hello, world!";
   return 0;
}

Three things:
• Don't put .h at the end of an #include statement
• It's int not void
• You forgot to put in an exit code

Hmm
1. Well thats a bit confusing its actually compiler dependent some needs .h , .c , .cpp extension , but some as VC 2008 dont need it  big_smile
2. The main statement can be VOID it is again dependent of Compiler TC3.1 supports a    void type main
3. if there is void type statement there is no need for return ;  tongue

Let me show you what i am working on At the moment

Rhy Racer || Complete Jst file Handling is left ||

Code:

//This is Source code in C++ for Rhy's Line Racer//

//Header files . (these are the basic thing that tell the computer what to do)
#include<iostream.h> // For basic In and out funcions
#include<graphics.h> // For Graphics
#include<Math.h> // for mathematical functions
#include<conio.h>// for keyboard Initialisation
#include<dos.h> // For MSDOS functions
#include<stdlib.h>//For some basic functions
#include<stdio.h>//
//Basic Functions(could be termed as scratch blocks) and Strutures( group of variables for an object)
// Coor declares a coordinate in 3 dimensions
struct coor{
int x;
int y;
int z;
};
//coor_xy is teh coordinate in 2 dimensions
struct coor_xy{
int x;
int y;
};

inline char keystroke()       // To check if a key is pressed and if pressed which one is pressed
{
    if(kbhit())
    {return getche();
    }
    else
    return 0;
}
inline coor_xy PntPos(coor P,coor Cam,int xrot,int yrot,int zrot,int f_len)  // The rhy's Gale1.2a programming this is how it looks in C++
{  int xy=(P.y*(cos(yrot))-P.z*(sin(yrot)));
   int xz=(P.y*(sin(yrot))+P.z*(cos(yrot)));
   int yz=(xz*(cos(xrot))-P.x*(sin(xrot)));
   int yx=(xz*(sin(xrot))+P.x*(cos(xrot)));
   int zx=(yx*(cos(zrot))-xy*(sin(zrot)));
   int zy=(yx*(sin(zrot))+xy*(cos(zrot)));
   int SFR=(f_len/f_len+yz+P.z+Cam.z);
   coor_xy ret;
   ret.x=(zx+P.x-Cam.x)*SFR;
   ret.y=(zy+P.y-Cam.y)*SFR;
   return ret;
}
inline int dist(coor P,coor Cam) // To find distance of 2 points I will use Draw distance
{ return sqrt(((P.x-Cam.x)*(P.x-Cam.x))+((P.y-Cam.y)*(P.y-Cam.y))+((P.z-Cam.z)*(P.z-Cam.z)));
}

void main() // This is the main thing that runs ie the When Flag clicked this thing runs :D though u can only have 1 main
{      coor Camera;     // Here is the declration of a coordinate camera
        //Lets initialise our camera at the starting position
        Camera.x=-100;
        Camera.y=0;
        Camera.z=-200;
           // The focal length
    int focallength = 10;
       fstream fin;
       fin::open("c:/autoexec.dat");



// INITIALISATION OF GRAPHIC DRIVERS
    /* request auto detection */
    int gdriver = DETECT, gmode, errorcode;
    int midx, midy, i;

/* initialize graphics, local variables*/
    initgraph(&gdriver, &gmode, "");

/* read result of initialization */
    errorcode = graphresult();
    if (errorcode != grOk)  /* an error
    occurred */
    {
    printf("Graphics error: %s\n", grapherrormsg(errorcode));
    printf("Press any key to halt:");
    getch();
    exit(1); /* terminate with error code */
    }
    char game ='y';    // a variable of type character that tells if the game loop has to be run or not
        do{ settextstyle(GOTHIC_FONT,0,5);   // This sets the text style to Gothic Font with size 5 and Horizontal typing
             for(float i=0;i<30;i+=5)// A loop that runs 6 times
                {
                     cleardevice();// the clear button
                     setbkcolor(GREEN);//sets background color to green
                     setcolor(i);// sets Pen color to variable value i
                     outtextxy(100,200,"Credits to Rhy & BWOG");
                     delay(400);// Halts the screen for 400 miliseconds
                }
            cleardevice();
            settextstyle(SANS_SERIF_FONT,0,20);
            outtextxy(190,140,"DG");
            settextstyle(SANS_SERIF_FONT,0,5);
            outtextxy(190,260,"Games");
            delay(900);
            cleardevice();
            settextstyle(0,0,6);
            setbkcolor(BLACK);
            setcolor(GREEN);
            outtextxy(10,10,"Line Racing");
            getch();
            settextstyle(0,0,2);
            outtextxy(0,180,"To Begin race press key");
            outtextxy(0,220," no options so far");
            getch(); // Halts the screen to the menu
            char RACE='t'; // Declares and sets a variable RACE to t which tells the Computer that race is going on

            coor Map[100];// Here is your map space  a list which contains 3 coordinate per element :D
            float Vel,Theta; // Variables for our car
            do
            {       cleardevice();//This gives us a fresh screen to paint
                for(int i=1;i<=100;i++)// Prints the MAP ALL AS WHOLE MUWHAHAHA C++ HAS NO PROBLEM PASTING THE WHOLE 100Point map its too mere for it :p
                {
                    lineto(PntPos(Map[i],Camera,0,0,0,focallength).x,PntPos(Map[i],Camera,0,0,0,focallength).y);// This function draws line from current point to the given point
                }
            char k = keystroke();   // sets a character variable keystroke to the keypressed
            if(k=='w') // Accelerates your car
            { if(Vel<12)
                Vel=Vel+1;
            }
            else if(k=='s')  // Brakes!!!!!!
            { if(Vel>0);
                Vel=Vel-1;
            }
            if(k=='a') // here we built the steering wheel though i think of using mouse rather then keyboard for directional control
            {     Theta = Theta+10/Vel;
            }
            else if(k=='d')
            {     Theta = Theta - 10/Vel;
            }
            if(k=='q')
            {     exit(1);// this means if Q is pressed the program will exit
            }

             // The following code tells the car to move
            Camera.x= Camera.x+Vel*cos(Theta);
            Camera.y= Camera.y+Vel*sin(Theta);
            delay(2);
 }while(RACE == 't');
    cleardevice();
    outtext("Do u want to Quit(y/n)");
    char ch= getche(); // Sets Game to N when the race is done and U want to quit;
      if(ch!='y'&&ch!='n')
      { do
        {    cleardevice();
            outtext("Do u want to Quit(y/n)");
            ch= getche();
        }while(ch=='y'&&ch=='n');
      }
      else
      game=ch;
}while(game=='y'); // Runs the loop till game =  Y

}

DG games GALEROIT ENGINE : an engine that supports both 3d and 2d graphics but at VGA
its the unfinished Galeroit.cpp

Code:

#include<iostream.h>
#include<conio.h>
#include<graphics.h>


//////////////////////////////////////////////////////////////////////////////
//Take it as a gift or a default directory for writing files on Roit Engine  /
//The only engine that can handle both 2d and 3d Data :D                     /
//Coder : Abhishek Hingnikar AKA fanofcena AKA Dark                          /
//Version: 0.1 Alpha                                                         /
//For Game : ACID TOXIC SURVIVAL
//Basic idea for writing this is to make it easier to depute the whole game
//into small basic parts or structures so that it becomes easy for someone else
//to understand                                             /
//////////////////////////////////////////////////////////////////////////////

struct coor{
         int x;
         int y;
         int z;
};
struct coorXY
{            int x;
         int y;
};
struct image{
         coorXY points[400];
         int color[400];
};
struct sprite2D{
         image Costume[10];
         coorXY Position;
         int Direction;

};

struct trngle{
         coor Points[3];
         int Color;
};

struct ANGLE3D
{ int xy;
  int yz;
  int xz;
};
struct Organ{

         trngle Polys[200];
         coor Position;
         ANGLE3D Angle;
};


Struct Body_Human{
         int Dress;
         Organ LeftHandHi;
         Organ LeftHandLo;
         Organ RightHandHi;
         Organ RightHandLo;
         Organ Head;
         Organ Midsection;
         Organ LeftLegHi;
         Organ LeftLegLo;
         Organ RightLegHi;
         Organ RightLegLo;
         Organ Pelvis;
         Organ Weapon;
         coor  Position;
         ANGLE3D angel;

};


inline void Key(int &key)
{ if(kbhit())
  key = getche();
  else
  key = 0;
}

// GALE 3D 1.2a By RHY : THIS IS WHAT MAKES RENDERING POSSIBLE

inline coor_xy PntPos(coor P,coor Cam,int xrot,int yrot,int zrot,int f_len) 
{  int xy=(P.y*(cos(yrot))-P.z*(sin(yrot)));
   int xz=(P.y*(sin(yrot))+P.z*(cos(yrot)));
   int yz=(xz*(cos(xrot))-P.x*(sin(xrot)));
   int yx=(xz*(sin(xrot))+P.x*(cos(xrot)));
   int zx=(yx*(cos(zrot))-xy*(sin(zrot)));
   int zy=(yx*(sin(zrot))+xy*(cos(zrot)));
   int SFR=(f_len/f_len+yz+P.z+Cam.z);
   coor_xy ret;
   ret.x=(zx+P.x-Cam.x)*SFR;
   ret.y=(zy+P.y-Cam.y)*SFR;
   return ret;
}





// Basic functions and structures for the Game

struct Humaniod{// this can be used for both Cyborgs and Humans :P
char Name[10];
Body_Hisbody hisbody;
int weps[3];
int Ammunation[3][3];
int Health;
}

This runs seemless on TC 3.1 due to graphics.h file  big_smile

Oh. It's just that I found an epic website that lets you learn C++ and it told me not to put .h and the end of an #include statement, use int main() not void main(), and to put return 0; at the end of the main() function.

EDIT: Now it said that you can use void main () instead of int main ()

Last edited by ThePCKid (2010-04-27 20:02:15)

Offline

 

#38 2010-04-28 02:18:16

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: YAY YAY YAY C#! :p

Xd


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#39 2010-04-28 07:50:29

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: YAY YAY YAY C#! :p

My version of the C++ program:

Code:

#include <iostream>

using namespace std;

int main() {
    cout << "Hello World!" << endl;
}

And, what do you think, if I say you that I can program in 26 programming languages (really!) ?


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#40 2010-04-28 08:11:42

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: YAY YAY YAY C#! :p

Umm...

Can we please get this topic back on to C#? I made a topic for C++ so this one can be on focus

Offline

 

#41 2010-04-28 08:12:46

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: YAY YAY YAY C#! :p

Sorry, I didn't see the topic... But now!


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#42 2010-04-28 10:56:33

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: YAY YAY YAY C#! :p

I use both C++ and C#, and iv touched a bit on C when modding. I like C...

My code for the hello world program.(Taken straight from the program)

Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello world!");
            Console.WriteLine("Press enter to exit...");
            Console.Read();
        }
    }
}

Last edited by markyparky56 (2010-04-28 11:00:27)


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#43 2010-04-28 17:24:50

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: YAY YAY YAY C#! :p

markyparky56 wrote:

I use both C++ and C#, and iv touched a bit on C when modding. I like C...

My code for the hello world program.(Taken straight from the program)

Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello world!");
            Console.WriteLine("Press enter to exit...");
            Console.Read();
        }
    }
}

Thanks!

Now I know how to stop it from exiting quickly...

Offline

 

#44 2010-04-28 19:07:56

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: YAY YAY YAY C#! :p

A fake OS that I made (under construction)

Code:

using System;

bool setupDone = false;
string username, password;

class FakeCSharpOS
{
    static void Main() {
        Console.WriteLine("Welcome to the fake C# OS!");
        if (setupDone == false)
        {
            Console.WriteLine("It looks like this is your first time using the fake C# OS.");
            Console.WriteLine("What would you want your username to be? ");
            username = Console.Read();
            Console.WriteLine("Username set!");
            Console.WriteLine("What would you want your password to be? ");
            password = Console.Read();
            Console.Clear();
        }
        TryToLogin();
    }
    
    static void TryToLogin() {
        string tempuser, temppass;
        Console.WriteLine("Username: ");
        tempuser = Console.Read();
        Console.WriteLine("Password: ");
        temppass = Console.Read();
        if (tempuser == username && temppass == password)
        {
            Console.Clear();
            LoadSpace();
        }
        else
        {
            Console.WriteLine("Incorrect username and/or password!");
            TryToLogin();
        }
    }
    
    static void LoadSpace() {
        Console.WriteLine("I'm sorry but this part is still under construction.");
        Console.WriteLine("Press enter to shutdown");
        Console.Read();
    }
}

Last edited by ThePCKid (2010-05-01 20:09:05)

Offline

 

#45 2010-04-29 09:20:42

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: YAY YAY YAY C#! :p

lol  When I get back to home, I can extend this  smile


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#46 2010-04-29 10:07:05

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: YAY YAY YAY C#! :p

but ur os requires Windows to run so its a VM  wink


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#47 2010-04-29 11:30:10

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: YAY YAY YAY C#! :p

fanofcena wrote:

but ur os requires Windows to run so its a VM  wink

What OS is <Insert persons name> using?


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#48 2010-04-29 11:34:03

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: YAY YAY YAY C#! :p

ThePCKid: Windows
I: Windows
fanofcena: I don't know.

Who do you mean?


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#49 2010-04-29 11:36:38

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: YAY YAY YAY C#! :p

meew0 wrote:

ThePCKid: Windows
I: Windows
fanofcena: I don't know.

Who do you mean?

No, its just I was wondering who Fanofcena was talking to.


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#50 2010-04-29 11:41:05

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: YAY YAY YAY C#! :p

Yay VM  smile  I like VMs more than OSs. I'm making a graphical VM in C#  big_smile  Current release preview: When I find the file on my computer, 2011  lol


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

Board footer