Ok. I have created very very simple level of primitives:
Header:
#pragma once
class Map
{
public:
int m_id;
int m_height;
int m_width;
void New(int id,int height,int width)//new map
{
m_id=id;
m_height=height;
m_width=width;
int newarray[10][10]={
{4,4,4,4,4,4,4,4,4,4},
{4,2,4,0,4,3,1,1,1,4},
{4,1,4,0,4,4,4,4,1,4},
{4,1,4,0,0,0,0,4,1,4},
{4,1,4,4,4,4,0,4,1,4},
{4,1,2,1,1,4,4,4,1,4},
{4,2,0,2,1,4,4,2,1,4},
{4,1,2,1,0,4,4,0,1,4},
{4,1,1,1,1,1,1,1,0,4},
{4,4,4,4,4,4,4,4,4,4}
};
for(int z=0; z<height; z++)
{
for(int x=0; x<width; x++)
{
id++;
if(newarray[x][z]!=0&newarray[x][z]<4)
{
dbMakeObjectBox(id,20,5,20);
dbPositionObject(id,x*20,0,z*20);
}
if(newarray[x][z]==1)
{
dbColorObject(id,dbRGB(255,0,0));
}else{dbColorObject(id,dbRGB(255,255,255));}
if(newarray[x][z]==2)
{
dbColorObject(id,dbRGB(0,255,0));
}
if(newarray[x][z]==3)
{
dbColorObject(id,dbRGB(0,0,255));
}
if(newarray[x][z]==4)
{
dbMakeObjectBox(id,20,15,20);
dbPositionObject(id,x*20,0,z*20);
}
}
}
}//end of new map
};
Main cpp
#include "DarkGDK.h"
#include "Main.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
Map level1;
level1.New(100,10,10);
dbPositionCamera(0,80,200,80);
dbHideMouse();
//dbMakeObjectSphere(10,1); <<when I uncomment these something stupid happens...
//dbPositionObject(10,30,5,30);
while ( LoopGDK ( ) )
{
dbPointCamera(0,80,10,80);
dbPositionMouse(dbScreenWidth()/2,dbScreenHeight()/2);
dbSync ( );
}
return;
}
What is bad? When I uncomment the Sphere Creation/position code my camera messes up. Dunno why.
Maybe some advice of how to make my level to increase degree by for example 45'degrees. I mean:
Now my level is:
________________
I want it to be like:
---/
--/
-/
/
It would be rolled by ~75 degrees. But every object. This is driving me crazy!
Thanks in advance!
~Murloc.
Theory-When you know everything,but nothing works.
Practice-When everything works,but you don't know why.
Programming merges these two-Nothing works,and you don't know why.