for( int i=0; i<256; i++)
{
tip = false;
}
#include <windows.h>
#include <GL/glut.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
#include <ctime>
#include <vector>
#include <dos.h>
#include <unistd.h>
#define RADIUS 0.0
#define FPS 6000
#define PI 3.14
void *font = GLUT_BITMAP_TIMES_ROMAN_24;
bool tip[256]; // Create an array of boolean values of length 256 (0-255)
using namespace std;
class Ship {
public:
double vx, vy, x, y, r,kroglax, kroglay;
int zdravje;
int direction;
Ship() {
r = 0.09;
x = -0.8;
y = -0.8;
direction = 0;
kroglax=-0.8;
kroglay=-0.8;
zdravje=100;
}
~Ship();
void move(){
izpis_zdravja();
//brez tega gre moja ladjica za večno stran
if (x > (1.0 + r) || x < (-1.0 - r))
x = -x;
if (y > (1.0 + r) || y < (-1.0 - r))
y = -y;
}
void izpis_zdravja(){
char a;
int i,len;
glRasterPos2f(0.8,0.8);
glutBitmapCharacter(font,i=(int)zdravje );
}
void draw() {
glBegin(GL_POLYGON);
glColor3d(0.5, 0.5, 0.5);
glVertex2f(sin((0 + direction)*PI/180)*r+x, cos((0 + direction)*PI/180)*r+y);
glVertex2f(sin((140 + direction)*PI/180)*r+x, cos((140 + direction)*PI/180)*r+y);
glVertex2f(sin((180 + direction)*PI/180)*r/4+x, cos((180 + direction)*PI/180)*r/4+y);
glVertex2f(sin((220 + direction)*PI/180)*r+x, cos((220 + direction)*PI/180)*r+y);
glEnd();
}
void left() {
direction = (direction - 6) % 360;
}
void right() {
direction = (direction + 6) % 360;
}
void acc() {
x += sin(direction*PI/180)*0.01;
y += cos(direction*PI/180)*0.01;
/*
y+=0.1*sin(direction);
x+=0.1*cos(direction);*/
}
void stop() {
vx = 0;
vy = 0;
}
void reset() {
stop();
direction = 1;
x = 0;
y = 0;
}
};
Ship* ship;
class montazna_ladja
{public:
double metekx, meteky, ladx, lady, ladr, metekr;
int k;
int direction;
montazna_ladja() {
metekr=0.07;
ladr = 0.07;
ladx = 0.8;
lady = -0.8;
k=0;
direction = 0;
}
~montazna_ladja();
void move() {
lady+=0.01;
//y+=0.0001;
if(lady>1)
ladx-=0.02;
Sleep(100);
double dx = ship->x - ladx;
double dy = ship->y - lady;
double ar = ship->r+ ladr;
dx=sqrt(dx*dx);
dy=sqrt(dy*dy);
if(dx<(0.5)&&dy<(0.1))
{
int i=0;
metekx=ladx;
meteky=lady;
do
{
metekx-= 0.01;
draw();
i++;
double dx = ship->x - metekx;
double dy = ship->y - meteky;
double ar = ship->r+ metekr;
if(dx*dx + dy*dy < ar*ar)
{
int a;
a=ship->zdravje;
a=a-10;
ship->zdravje=a;
if((ship->zdravje)==0)
ship->reset();
}
}
while(i<75);
}
if (ladx > (1.0) || ladx < (-1.0 - ladr))
ladx = -ladx;
if (lady > (1.0 + ladr) || lady < (-1.0 - ladr))
lady = -lady;
}
void draw() {
glBegin(GL_POLYGON);
glColor3d(0.5, 0.5, 0.5);
glVertex2f(sin((0 + direction)*PI/180)*ladr+ladx, cos((0 + direction)*PI/180)*ladr+lady);
glVertex2f(sin((140 + direction)*PI/180)*ladr+ladx, cos((140 + direction)*PI/180)*ladr+lady);
glVertex2f(sin((180 + direction)*PI/180)*ladr/4+ladx, cos((180 + direction)*PI/180)*ladr/4+lady);
glVertex2f(sin((220 + direction)*PI/180)*ladr+ladx, cos((220 + direction)*PI/180)*ladr+lady);
glEnd();
}
};
montazna_ladja* Montazna_ladja;
class metki{
public:
double x, y, r;
int smer,strel;
// int direction;
metki()
{
r = 0.07;
x = -0.8;
y = -0.8;
strel = 0; // <-------- nastavi vrednost na 0 (metek ne leti)
}
~metki();
void move()
{
x=ship->x;
y=ship->y;
smer=ship->direction;
if(strel == 1)
{
x+= 0.01;
cout<<"iuvajam strel";
double dx = Montazna_ladja->ladx - x;
double dy = Montazna_ladja->lady - y;
double ar = Montazna_ladja->ladr + r;
if(dx*dx + dy*dy < ar*ar)
{ cout<<"zadel sem ladjo";
ship->reset();
strel = 0;
x = ship->x;
y = ship->y;
}
}
}
void draw()
{
glBegin(GL_POLYGON);
glColor3d(0.5, 0.5, 0.5);
glVertex2f(sin((0 + smer)*PI/180)*r+x, cos((0 + smer)*PI/180)*r+y);
glVertex2f(sin((140 + smer)*PI/180)*r+x, cos((140 + smer)*PI/180)*r+y);
glVertex2f(sin((180 + smer)*PI/180)*r/4+x, cos((180 + smer)*PI/180)*r/4+y);
glVertex2f(sin((220 + smer)*PI/180)*r+x, cos((220 + smer)*PI/180)*r+y);
glEnd();
glBindTexture(GL_TEXTURE_2D,5);
}
};
metki *Metki;
void tipkovnica (unsigned char tipka, int x, int y) {
tip[tipka] = true; // Set the state of the current key to pressed
cout<< tipka ; //<-------------
}
void tipkovnica2 (unsigned char tipka, int x, int y) {
tip[tipka] = false; // Set the state of the current key to not pressed
}
void pritisni (void) {
if (tip['a'])
{ ship->left();
cout<<"a"; }
else if (tip['d'])
{ ship->right();
cout<<"a"; }
else if (tip['w'])
{ ship->acc();
cout<<"a"; }
else if (tip['m'])
{
Metki->strel=1;
cout<<"a"; }
else if(!((tip['a'])&&(tip['d'])&&(tip['w'])&&(tip['m'])))
{
}}
static bool collision() {
bool coll = false;
// stik ladje z ladjo
double dx = Montazna_ladja->ladx - ship->x;
double dy = Montazna_ladja->lady - ship->y;
double ar = Montazna_ladja->ladr + ship->r;
if(dx*dx + dy*dy < ar*ar)
{
ship->reset();
}
// ostale stik
return coll;
}
static void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Izris
ship->draw();
Montazna_ladja->draw();
Metki->draw();
glFlush();
glutSwapBuffers();
}
static void Update(int value)
{pritisni();
glutPostRedisplay();
ship->move();
Montazna_ladja->move();
Metki->move();
collision();
}
int main(int argc, char** argv) // <---------------------------------------MAIN
{for( int i=0; i<256; i++)
{
tip[i] = false;
}
// srand((unsigned)time(0));
ship = new Ship();
Montazna_ladja= new montazna_ladja();
Metki= new metki();
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE);
glutInitWindowPosition(10, 10);
glutInitWindowSize(512, 512);
glutCreateWindow("Krneki");
glutKeyboardFunc(tipkovnica);
glutKeyboardUpFunc(tipkovnica2);
glutDisplayFunc(display);
glutTimerFunc(1000/FPS, Update, 10); // <--------
glutMainLoop();
return 1;
// system("pouse");
}
metki()
{
r = 0.07;
x = -0.8;
y = -0.8;
strel = 0; // <-------- nastavi vrednost na 0 (metek ne leti)
}
~metki();
void move()
{
x=ship->x; <-----
y=ship->y; <---------
smer=ship->direction;
metki()
{
r = 0.07;
x = -0.8;
y = -0.8;
strel = 0; // <-------- nastavi vrednost na 0 (metek ne leti)
x=ship->x;
y=ship->y;
}
~metki();
void move()
{
smer=ship->direction;
static void Update(int value)
{pritisni();
glutPostRedisplay();
ship->move();
Montazna_ladja->move();
Metki->move();
collision();
glutTimerFunc(1000/FPS, Update, 1);
}
#include <windows.h>
#include <GL/glut.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
#include <ctime>
#include <vector>
#include <dos.h>
#include <unistd.h>
#define RADIUS 0.0
#define FPS 6000
#define PI 3.14
void *font = GLUT_BITMAP_TIMES_ROMAN_24;
char tip[256]; // Create an array of boolean values of length 256 (0-255)
using namespace std;
class Ship {
public:
double vx, vy, x, y, r,kroglax, kroglay;
int zdravje;
int direction;
Ship() {
r = 0.09;
x = -0.8;
y = -0.8;
direction = 0;
kroglax=-0.8;
kroglay=-0.8;
zdravje=100;
}
~Ship();
void move(){
izpis_zdravja();
//brez tega gre moja ladjica za veèno stran
if (x > (1.0 + r) || x < (-1.0 - r))
x = -x;
if (y > (1.0 + r) || y < (-1.0 - r))
y = -y;
}
void izpis_zdravja(){
char a;
int i,len;
glRasterPos2f(0.8,0.8);
glutBitmapCharacter(font,i=(int)zdravje );
}
void draw() {
glBegin(GL_POLYGON);
glColor3d(0.5, 0.5, 0.5);
glVertex2f(sin((0 + direction)*PI/180)*r+x, cos((0 + direction)*PI/180)*r+y);
glVertex2f(sin((140 + direction)*PI/180)*r+x, cos((140 + direction)*PI/180)*r+y);
glVertex2f(sin((180 + direction)*PI/180)*r/4+x, cos((180 + direction)*PI/180)*r/4+y);
glVertex2f(sin((220 + direction)*PI/180)*r+x, cos((220 + direction)*PI/180)*r+y);
glEnd();
}
void left() {
direction = (direction - 6) % 360;
}
void right() {
direction = (direction + 6) % 360;
}
void acc() {
x += sin(direction*PI/180)*0.01;
y += cos(direction*PI/180)*0.01;
/*
y+=0.1*sin(direction);
x+=0.1*cos(direction);*/
}
void stop() {
vx = 0;
vy = 0;
}
void reset() {
stop();
direction = 1;
x = 0;
y = 0;
}
};
Ship* ship;
class montazna_ladja
{public:
double metekx, meteky, ladx, lady, ladr, metekr;
int k;
int direction;
montazna_ladja() {
metekr=0.07;
ladr = 0.07;
ladx = 0.8;
lady = -0.8;
k=0;
direction = 0;
}
~montazna_ladja();
void move() {
lady+=0.01;
//y+=0.0001;
if(lady>1)
ladx-=0.02;
Sleep(100);
double dx = ship->x - ladx;
double dy = ship->y - lady;
double ar = ship->r+ ladr;
dx=sqrt(dx*dx);
dy=sqrt(dy*dy);
if(dx<(0.5)&&dy<(0.1))
{
int i=0;
metekx=ladx;
meteky=lady;
do
{
metekx-= 0.01;
draw();
i++;
double dx = ship->x - metekx;
double dy = ship->y - meteky;
double ar = ship->r+ metekr;
if(dx*dx + dy*dy < ar*ar)
{
int a;
a=ship->zdravje;
a=a-10;
ship->zdravje=a;
if((ship->zdravje)==0)
ship->reset();
}
}
while(i<75);
}
if (ladx > (1.0) || ladx < (-1.0 - ladr))
ladx = -ladx;
if (lady > (1.0 + ladr) || lady < (-1.0 - ladr))
lady = -lady;
}
void draw() {
glBegin(GL_POLYGON);
glColor3d(0.5, 0.5, 0.5);
glVertex2f(sin((0 + direction)*PI/180)*ladr+ladx, cos((0 + direction)*PI/180)*ladr+lady);
glVertex2f(sin((140 + direction)*PI/180)*ladr+ladx, cos((140 + direction)*PI/180)*ladr+lady);
glVertex2f(sin((180 + direction)*PI/180)*ladr/4+ladx, cos((180 + direction)*PI/180)*ladr/4+lady);
glVertex2f(sin((220 + direction)*PI/180)*ladr+ladx, cos((220 + direction)*PI/180)*ladr+lady);
glEnd();
}
};
montazna_ladja* Montazna_ladja;
class metki{
public:
double x, y, r;
int smer,strel;
// int direction;
metki()
{
r = 0.07;
x = -0.8;
y = -0.8;
strel = 0; // <-------- nastavi vrednost na 0 (metek ne leti)
}
~metki();
void move()
{
/* x=ship->x;
y=ship->y;
smer=ship->direction;*/
if(strel == 1)
{
x+= 0.01;
cout<<"iuvajam strel";
double dx = Montazna_ladja->ladx - x;
double dy = Montazna_ladja->lady - y;
double ar = Montazna_ladja->ladr + r;
if(dx*dx + dy*dy < ar*ar)
{ cout<<"zadel sem ladjo";
ship->reset();
strel = 0;
x = ship->x;
y = ship->y;
}
}
}
void draw()
{
glBegin(GL_POLYGON);
glColor3d(0.5, 0.5, 0.5);
glVertex2f(sin((0 + smer)*PI/180)*r+x, cos((0 + smer)*PI/180)*r+y);
glVertex2f(sin((140 + smer)*PI/180)*r+x, cos((140 + smer)*PI/180)*r+y);
glVertex2f(sin((180 + smer)*PI/180)*r/4+x, cos((180 + smer)*PI/180)*r/4+y);
glVertex2f(sin((220 + smer)*PI/180)*r+x, cos((220 + smer)*PI/180)*r+y);
glEnd();
glBindTexture(GL_TEXTURE_2D,5);
}
};
metki *Metki;
void tipkovnica (unsigned char tipka, int x, int y) {
tip[tipka] = true; // Set the state of the current key to pressed
cout<< tipka ; //<-------------
}
void tipkovnica2 (unsigned char tipka, int x, int y) {
tip[tipka] = false; // Set the state of the current key to not pressed
}
void pritisni (void) {
if (tip['a'])
{ ship->left();
cout<<"a"; }
else if (tip['d'])
{ ship->right();
cout<<"a"; }
else if (tip['w'])
{ ship->acc();
cout<<"a"; }
else if (tip['m'])
{
Metki->strel=1;
cout<<"jd"; }
else if(!((tip['a'])&&(tip['d'])&&(tip['w'])&&(tip['m'])))
{
}}
static bool collision() {
bool coll = false;
// stik ladje z ladjo
double dx = Montazna_ladja->ladx - ship->x;
double dy = Montazna_ladja->lady - ship->y;
double ar = Montazna_ladja->ladr + ship->r;
if(dx*dx + dy*dy < ar*ar)
{
ship->reset();
}
// ostale stik
return coll;
}
static void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Izris
ship->draw();
Montazna_ladja->draw();
Metki->draw();
glFlush();
glutSwapBuffers();
}
static void Update(int value)
{pritisni();
glutPostRedisplay();
ship->move();
Montazna_ladja->move();
Metki->move();
collision();
glutTimerFunc(1000/FPS, Update, 1);
}
int main(int argc, char** argv) // <---------------------------------------MAIN
{for( int i=0; i<256; i++)
{
tip[i] = false;
}
// srand((unsigned)time(0));
ship = new Ship();
Montazna_ladja= new montazna_ladja();
Metki= new metki();
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE);
glutInitWindowPosition(10, 10);
glutInitWindowSize(512, 512);
glutCreateWindow("Krneki");
glutKeyboardFunc(tipkovnica);
glutKeyboardUpFunc(tipkovnica2);
glutDisplayFunc(display);
glutTimerFunc(1000/FPS, Update, 10); // <--------
glutMainLoop();
return 1;
// system("pouse");
}
#include <vector.h>
vector<Metek*> listaMetkov; // s tem ustvarimo vektor metkov
Metek * tmp = new Metek();
tmp->x = ...
tmp->y = ...
listaMetkov.push_back(tmp);
for( int i=0; i<listaMetkov.size(); i++ )
{
if( !listaMetkov.at(i)->readytoclear )
listaMetkov.at( i )->Move(); else
listaMetkov.clear( listaMetkov.begin() + i );
}
for( int i=0; i<listaMetkov.size(); i++ )
{
listaMetkov.at( i )->Draw();
}
void move()
{
/* x=ship->x;
y=ship->y;
smer=ship->direction;*/
if(strel == 1)
{
i++;
cout<<" "<<i;
x+= 0.003;
double dx = Sovrazna_ladja->ladx - x;
double dy = Sovrazna_ladja->lady - y;
double ar = Sovrazna_ladja->ladr + r;
if(dx*dx + dy*dy < ar*ar)
{
ship->reset();
strel = 0;
i=0;
}
if(i>=670)
{
strel=0;
i=0;
}
}
}
void draw()
{
if( x > 640 || x < 0) unicimetek = true;
if( y > 480 || y < 0) unicimetek = true;
#include <windows.h>
#include <GL/glut.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
#include <vector>
#define RADIUS 0.0
#define FPS 60
#define PI 3.14
#define METKI 10
void *font = GLUT_BITMAP_TIMES_ROMAN_24;
char tip[256]; // Create an array of boolean values of length 256 (0-255)
using namespace std;
class Ship {
public:
double vx, vy, x, y, r,kroglax, kroglay;
int zdravje;
int direction;
Ship() {
r = 0.09;
x = -0.8;
y = -0.8;
direction = 0;
kroglax=-0.8;
kroglay=-0.8;
zdravje=100;
}
~Ship();
void move(){
izpis_zdravja();
//brez tega gre moja ladjica za veèno stran
if (x > (1.0 + r) || x < (-1.0 - r))
x = -x;
if (y > (1.0 + r) || y < (-1.0 - r))
y = -y;
}
void izpis_zdravja(){
char a;
int i,len;
glRasterPos2f(0.8,0.8);
glutBitmapCharacter(font,i=(int)zdravje );
}
void draw() {
glBegin(GL_POLYGON);
glColor3d(0.5, 0.5, 0.5);
glVertex2f(sin((0 + direction)*PI/180)*r+x, cos((0 + direction)*PI/180)*r+y);
glVertex2f(sin((140 + direction)*PI/180)*r+x, cos((140 + direction)*PI/180)*r+y);
glVertex2f(sin((180 + direction)*PI/180)*r/4+x, cos((180 + direction)*PI/180)*r/4+y);
glVertex2f(sin((220 + direction)*PI/180)*r+x, cos((220 + direction)*PI/180)*r+y);
glEnd();
}
void left() {
direction = (direction - 6) % 360;
}
void right() {
direction = (direction + 6) % 360;
}
void acc() {
x += sin(direction*PI/180)*0.01;
y += cos(direction*PI/180)*0.01;
/*
y+=0.1*sin(direction);
x+=0.1*cos(direction);*/
}
void stop() {
vx = 0;
vy = 0;
}
void reset() {
stop();
direction = 1;
x = 0;
y = 0;
}
};
Ship* ship;
class sovrazna_ladja
{public:
double metekx, meteky, ladx, lady, ladr, metekr;
int k;
int direction;
sovrazna_ladja() {
metekr=0.07;
ladr = 0.07;
ladx = 0.8;
lady = -0.8;
k=0;
direction = 0;
}
~sovrazna_ladja();
void move() {
lady+=0.003;
//y+=0.0001;
if(lady>1)
ladx-=0.02;
double dx = ship->x - ladx;
double dy = ship->y - lady;
double ar = ship->r+ ladr;
dx=sqrt(dx*dx);
dy=sqrt(dy*dy);
if(dx<(0.5)&&dy<(0.1))
{
int i=0;
metekx=ladx;
meteky=lady;
/*
)
do
{
metekx-= 0.01;
draw();
i++;
double dx = ship->x - metekx;
double dy = ship->y - meteky;
double ar = ship->r+ metekr;
if(dx*dx + dy*dy < ar*ar)
{
int a;
a=ship->zdravje;
a=a-10;
ship->zdravje=a;
if((ship->zdravje)==0)
ship->reset();
}
}
while(i<75);
*/
}
if (ladx > (1.0) || ladx < (-1.0 - ladr))
ladx = -ladx;
if (lady > (1.0 + ladr) || lady < (-1.0 - ladr))
lady = -lady;
}
void draw() {
glBegin(GL_POLYGON);
glColor3d(0.5, 0.5, 0.5);
glVertex2f(sin((0 + direction)*PI/180)*ladr+ladx, cos((0 + direction)*PI/180)*ladr+lady);
glVertex2f(sin((140 + direction)*PI/180)*ladr+ladx, cos((140 + direction)*PI/180)*ladr+lady);
glVertex2f(sin((180 + direction)*PI/180)*ladr/4+ladx, cos((180 + direction)*PI/180)*ladr/4+lady);
glVertex2f(sin((220 + direction)*PI/180)*ladr+ladx, cos((220 + direction)*PI/180)*ladr+lady);
glEnd();
}
};
sovrazna_ladja* Sovrazna_ladja;
class metki{
public:
double x, y, r;
int smer,strel;
int i;
// int direction;
metki()
{
r = 0.02;
x = -0.8;
y = -0.8;
strel = 0;// <-------- nastavi vrednost na 0 (metek ne leti)
i=0;
}
~metki();
void move()
{
/* x=ship->x;
y=ship->y;
smer=ship->direction;*/
if(strel == 1)
{
i++;
cout<<" "<<i;
x+= 0.003;
double dx = Sovrazna_ladja->ladx - x;
double dy = Sovrazna_ladja->lady - y;
double ar = Sovrazna_ladja->ladr + r;
if(dx*dx + dy*dy < ar*ar)
{
ship->reset();
strel = 0;
i=0;
}
if(i>=670)
{
strel=0;
i=0;
}
}
}
void draw()
{
glBegin(GL_POLYGON);
glColor3d(0.5, 0.5, 0.5);
glVertex2f(sin((0 + smer)*PI/180)*r+x, cos((0 + smer)*PI/180)*r+y);
glVertex2f(sin((140 + smer)*PI/180)*r+x, cos((140 + smer)*PI/180)*r+y);
glVertex2f(sin((180 + smer)*PI/180)*r/4+x, cos((180 + smer)*PI/180)*r/4+y);
glVertex2f(sin((220 + smer)*PI/180)*r+x, cos((220 + smer)*PI/180)*r+y);
glEnd();
glBindTexture(GL_TEXTURE_2D,5);
}
};
vector<metki*> Metki; // s tem ustvarimo vektor metkov
void tipkovnica (unsigned char tipka, int x, int y) {
tip[tipka] = true; // Set the state of the current key to pressed
cout<< tipka ; //<-------------
}
void tipkovnica2 (unsigned char tipka, int x, int y) {
tip[tipka] = false; // Set the state of the current key to not pressed
}
void pritisni (void) {
if (tip['a'])
{ ship->left();
cout<<"a"; }
if (tip['d'])
{ ship->right();
cout<<"a"; }
if (tip['w'])
{ ship->acc();
cout<<"a"; }
if (tip['m'])
{
[color=#FF0000] for(int i=0; i<Metki.size()-1; i++) {
Metki[i]->strel=1;
cout<<"jd"; }[/color]
}
}
static bool collision() {
bool coll = false;
// stik ladje z ladjo
double dx = Sovrazna_ladja->ladx - ship->x;
double dy = Sovrazna_ladja->lady - ship->y;
double ar = Sovrazna_ladja->ladr + ship->r;
if(dx*dx + dy*dy < ar*ar)
{
ship->reset();
}
// ostale stik
return coll;
}
static void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Izris
ship->draw();
Sovrazna_ladja->draw();
[color=#FF0000] for(int i=0; i<Metki.size()-1; i++) {
if(Metki[i]->strel==1)
{
Metki.at(i)->draw();
}
else
{
Metki[i]->x = ship->x;
Metki[i]->y = ship->y;
}[/color]
glFlush();
glutSwapBuffers();
}}
static void Update(int value)
{pritisni();
glutPostRedisplay();
ship->move();
Sovrazna_ladja->move();
[color=#FF0000]for(int i=0; i<Metki.size()-1; i++) {
Metki[i]->move();
}[/color]
collision();
glutTimerFunc(1000/FPS, Update, 1);
}
int main(int argc, char** argv) // <---------------------------------------MAIN
{for( int i=0; i<256; i++)
{
tip[i] = false;
}
// srand((unsigned)time(0));
ship = new Ship();
[color=#FF0000] for (int i=0; i<METKI; i++) {
Metki.push_back(new metki());}
// cout << asteroids[i]->x << " " << asteroids[i]->y << endl;
[/color]
Sovrazna_ladja= new sovrazna_ladja();
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE);
glutInitWindowPosition(10, 10);
glutInitWindowSize(512, 512);
glutCreateWindow("Krneki");
glutKeyboardFunc(tipkovnica);
glutKeyboardUpFunc(tipkovnica2);
glutDisplayFunc(display);
glutTimerFunc(FPS, Update, 10); // <--------
glutMainLoop();
return 1;
// system("pouse");
}
for(int i=0; i<Metki.size()-1; i++)
{
Metki[i]->move();
}
for(int i=0; i<Metki.size()-1; i++)
{
Metki.at(i)->move();
}
if (tip['m'])
{
Metki.push_back(new metki()); <---
cout<<"Metek ustvarjen";
}
Po forumu brska: 0 registriranih uporabnikov in 1 gost