Me and my friend are working on a flight Simulation system that can/may be used in Games, and will actually be used on a hardware remote plane after all the project is done, I am doing the programming/maths/some physics and my friend is an aerospace engineer who will be advising me through the programming in what need's doing and will be putting the hardware version of the plane together.
All the programming will be done a a huge array of classes that hold some superior complexity, but I was going over a rough drafts and ideas with him today and thought I'd post it on here - feel free to comment, if you like I could post the finished source on here in a couple of months time (thousands of lines of code, lib, *.h, *.cpp, etc) if you'd like:
Obviously don't take this code literally, it was just some ideas, I'm just coding a timer at the moments and some drivers etc.
All the programming will be done a a huge array of classes that hold some superior complexity, but I was going over a rough drafts and ideas with him today and thought I'd post it on here - feel free to comment, if you like I could post the finished source on here in a couple of months time (thousands of lines of code, lib, *.h, *.cpp, etc) if you'd like:
Obviously don't take this code literally, it was just some ideas, I'm just coding a timer at the moments and some drivers etc.
Code
//Flight simulation program by System error [email protected]
#include <iostream>
#include <stdlib.h>
#include <string>
using namespace std;
//relevant headers 'n' libs
void main(void) //avoid return val with void func
{
//main int vars
int FCC = 0, Fuel = 100, Health_detection = 0, Lwing = 0, Rwing = 0, body = 0,
x = 0, y = 0, accel = 0, V = 0, Collision = 0, xv = 0, yv = 0, time = 0;
//menu
cout<<" ||FLIGHT SIMULATOR||\n\n";
cout<<"FCC status entire machine not operated\n";
//infinate loop for repetatice query
cout<<"Now imagine you're controlling the aircrart\nwhat would you like to do?:\n";
cout<<"--------------------------------------------------------------------\n";
cout<<"a1 = accelleration (Stage 1)\na2 = lift-off (Stage 2)\na3 = down (optional)\na3 = Left turn(optional)\n";
cout<<"a4 = Right Turn (optional)\na5 = Fuel status (Check fuel status)\na6 = Health (Check health)\na7 = Flight_time (View air time spent)\n\n";
//input vars for menu
string a1 = "a1", a2 = "a2", a3 = "a3", a4 = "a4", a5 = "a5", a6 = "a6", a7 = "a7";
string input;
cin>>input;
if(input == a1)
{
cout<<"How many times would you loop this?:\n";
int inputloop;
cin>>inputloop;
for(int count = 0; count < inputloop; count++)
{
cout<<"Increasing Accelleration, auto lifting off\n\n";
accel++;
time++;
V = accel*time;
Fuel += -1;
cout<<"accel is now : "<<accel<<"\n"<<"time is now :"<<time<<"\n"<<"Velocity is now :"<<V<<"\n"<<"Fuel decreased from 100% to "<<Fuel<<endl;
//nice fuel warning system
if(Fuel == 50)
{
cout<<"\n--Alert to FCC: you have half of your fuel left";
}
else if(Fuel == 15)
{
cout<<"\n--Alert** you only have a quarter of your fuel left!\nGet the parahute ready";
}
else if(Fuel == 0)
{
cout<<"\n---WARNING!! fuel empty---";
}
}
}
else
{
cout<<"This function is not implemented yet, only function a1 is working\n";
}
}
