2019-03-31 03:33:17 (edited by Kitsune 2019-03-31 03:34:08)

ok. so I wanna make a little game. but, it envalls walking. I wanna make a 3d grid. how do you do that?
and doen't tell me to look in the help file, I looked in there all ready
thanks!

I am a divine being. I can be called a primordial deity, but that might be pushing it, a smidge. I am the only one of my kind to have ten tails, with others having nine. I don't mean to sound arrogant, but I have ascended my own race.

2019-03-31 03:56:05

look in the... ah...
The help file explains vectors if you would bother to read the references.
vector me(0,0,0);

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)

2019-03-31 06:34:24

Vectors actually have nothing at all to do with a 3d grid. You could just as easily represent the player position with int x,y,z;
Either way, in order to create a 3d grid you have to apply logic. Have you ever created a sidescroller or a 2d grid? IF not, you should probably start there or even at a lower point depending on how far you're jumping ahead in this case.

2019-03-31 13:59:51 (edited by mohamed 2019-03-31 14:02:51)

I was searching for this either
The help file is sometimes  confusing

2019-03-31 23:40:07

it is

I am a divine being. I can be called a primordial deity, but that might be pushing it, a smidge. I am the only one of my kind to have ten tails, with others having nine. I don't mean to sound arrogant, but I have ascended my own race.

2019-04-01 00:11:45

The help file for the language is not intended to teach you how to make whatever complete game you want. It's intended to teach you the fundamentals of how to make whatever game you want so that then you can apply those fundamentals.

2019-04-01 04:02:04

Ok, so, you could use ectors, or as lucas said, int x, y, z;
Maybe something along the lines of this. This code wouldn't work correctly but screw off.

int x, y, z; //the players coordinates.
int jumping; //we'll just have this here in case you wanta make jumping;
//declare some sounds
sound step; sound jump; sound ambience;
void main() //hope I don't gotta explain this.
{
//load the sounds.
step.load("step.ogg");
jump.load("jump.ogg");
//etc.
ambience.play_looped();
while(key_pressed(KEY_ESCAPE)=false) //Declare that the following will occur if the key escape is pressed.
{
if(key_pressed(KEY_UP))
{
move(forward); //call the move void, with the directcion of forward.
}
//do that for all the arrows.
}
if(key_pressed(KEY_ESCAPE))
{
exit();
}
}
void move(string direction) //call a move function, that will take the direction that you move.
{
step.play();
if(direction=forward)
{
y++;
}
//etc.
}

Now that was thrown together in 5 minutes, and I don't even think that would work, considering I have a vary limited grasp on loops, for some reason they won't work for me, and that I'm not sure if I did the void with an enclosed var correctly. Please correct me if I did that rong, cause I'd love to learn myself.

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)

2019-04-06 00:40:28 (edited by Zarvox 2019-04-06 00:42:52)

I used already written code to turn a 2d into a 3d game. There is a 7z folder of 25 open source projects you can use. I used the zombie war game. First I stripped all the stuff I didn't want. Then I stripped the enemy and weapon code so it was just a map. Oh and no objects either. Then I took the existing map an added a z axis. I use it for any map projects now. However I have stopped working with maps because I do not have jump and land code. I also do not know how to prevent the timer from automatically starting when the game starts. Map games are very difficult to work with, they are not for beginners. I still count myself as a beginner even though I was able to add an axis to the map.

2019-04-06 08:00:14

adding an axis isn't all that difficult.
Jumping, maybe something like this: Although it's done in za:

if(key_pressed(KEY_SPACE) and jumptimer.elapsed>=jumptime)
{
jump.play();
if(jumprisetimer.elapsed>=jumprisetime)
{
me.z++;
}
}

etc

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)