Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 8th Mar 2004 00:42
Could someone help me make 2D pacman in DBPro like the 3D pong thread becuase i've tried but found use tiles confusin'
please help.

diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 8th Mar 2004 07:01
i would like that too.my wife wants me to make her a pacman game.

please dont make fun of my spelling,or sentence structure.Id rather study math or programming
diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 8th Mar 2004 18:32
gamemakerjason
i emailed my friend who makes tutorials for db.i asked him to make a pacman one for us.he said he will work on it.if i hear any more about it i will post it here.

please dont make fun of my spelling,or sentence structure.Id rather study math or programming
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 8th Mar 2004 18:46
great i would love it if you helped.

Will it be like a the thread my fist pong game?

Can you start soon?

diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 8th Mar 2004 22:05 Edited at: 8th Mar 2004 22:20
i wish i could look at your stuff on your link but im at work right now. i will see it in a few hours and edit this post.but this project should be great because my friend said he has written tutorials for db.im not sure which ones.anyway he said he will get started.he is not sure if he will have time to finish it.i will let you know as i find out.i dont like to ask him alot of questions.i respect his time.i asked him to do this pacman because i was wanting to make one anyway.seeing that you want a tutorial i thought maybe it will help alot of people.

please dont make fun of my spelling,or sentence structure.Id rather study math or programming
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 8th Mar 2004 22:52
I'm making a pac man game too!, I'm positioning the pills

CURRENT PROJECT: RETRO PAC-MAN
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 8th Mar 2004 23:16
Bah, I could *TRY* and write you a tutorial in Classic, but y'all are using Pro...
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 8th Mar 2004 23:19
BTW, if you did still want me to help you like Chris Knott did in the 3D Pong thread I could do it in classic which you could just convert to Pro... And, if you wanted to make it in 3D I think it would be MUCH easier and cooler, but you decide...
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 9th Mar 2004 00:04
I would like to learn how to make it in 2D like the classic but 3D would also be great. (doen't matter which)

Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 9th Mar 2004 00:09
Okay, well, I'll start up on the 3D one, since it should be easier and I'm not very good at 2D... Okay... Expect my first post by tonight...
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 9th Mar 2004 00:41 Edited at: 9th Mar 2004 00:42
Okay... First thing is first, we need to make pacman.

To do this we use this code: make object sphere Object number, Radius value

Make object sphere will create a sphere object with the Object number you set, and the Radius value you set... To create a fair sized pacman use this code...

Make object sphere 1, 6

Then, we want to color the object yellow... To do this, use the following code...

color object 1, RGB(247,252,44)

What this does is color the object, 1 in this case, to the RGB value we set next.

Then we have to position pacman, later on we'll create a matrix to serve as our floor, but right now just put him right here:

position object 1, 87, 0, 87

Okay... Now, so that we can see pacman:

Position camera 87, 150, 87

What this does is put the camera at X(87),Y(150),Z(87)

And then, one final thing to point the camera at our pacman then we use the following command:

point camera 87,0,87

Now then, once all this is put in there you should see a yellow sphere in the middle of your screen, not much yet, but it's a start...

You should have something like this at the end:



That's all for now. I'll do more later.
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 9th Mar 2004 00:53
BTW, tell me if I'm going in to too much detail, not enough detail, or any comments so I can make it better for you...
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 9th Mar 2004 00:54
is my pacman meant to look 2D?

Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 9th Mar 2004 00:55
Yes, when I get to movement you'll see that it is actually 3D, basically it's going to be a 3D rendered 2D type pacman, meaning it's all 3D objects, but it's a top down view.
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 9th Mar 2004 01:10
Now then, onto movement. First thing that you'll want to do is this: Make two variables called X# and Z#, these will be what we change to make pacman move around. To do this add these lines of code at the beginning of your code.

X# = 87
Z# = 87


Now then, after this you'll want to make a main game loop. We do this by using the commands DO and LOOP.

DO

LOOP


Everything inside those two commands will keep on running until escape is pressed, which will end the program. Now then, to make pacman move is quite simple. DB has provided us with the helpful commands for the arrowkeys, these are: Leftkey(), Rightkey(), Upkey(), Downkey(). You'll want to put these in your main game loop.

To make pacman move up use this code:

if Upkey()=1 then Z# = Z# + 1

To make pacman move left then use this:

if Leftkey()=1 then X# = X# - 1

See if you can figure out how to make pacman move right and down. If you can't figure it out, the code will be at the end.

Now then, one last thing. You have to update pacmans position at the end of each loop so that you can see his movement. To do this, we use Position Object.

Position object 1,X#, 0, Z#

What that will do is position pacman at the X# and Z# integers. Simple, eh?


If you couldn't figure out down and right then here is the code:



Your code should now look like this:


Try it out, now you can move him around!

Next: Making the floor and not letting pacman go outside the floor.
diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 9th Mar 2004 04:43
thanks i gotta do a few things before i start trying it

please dont make fun of my spelling,or sentence structure.Id rather study math or programming
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 9th Mar 2004 05:01
Moving on to adding in the floor...

I'm assuming that you own Dark Basic and have all the media that came along with it, I'm also assuming that DBPro comes with the texture I'm using here, if not, find one yourself and use that in place of the image filename.

Basically, to create the floor, what we need is a matrix. This matrix will be our level holder and will be what pacman and everything else is upon. Okay, first things first: Loading in the texture.

To do this, we load in a 2D image from the hard drive, I use Vinal01 because it looks like a good arcade texture. Use this code to load in whatever texture you want to use:

Load image "Vinal01.bmp", 1

That loads in the image, and stores it in whatever image number you like. Now we have to create the matrix.

All you have to do for this is to use the command Make Matrix.

For the purposes of this tutorial I find that using a 175 by 175 matrix works best, to create one of these use this command:

Make matrix 1, 175, 175, 8, 8


From here we want to prepare the matrix texture, and then texture the matrix. basically, all we need to do is do these commands:

Prepare matrix texture 1,1,1,1

and

Fill matrix 1,0,1

What that does is prepare the matrix texture for matrix 1, out of image 1, and then it fills the matrix with the prepared texture. For more info check your manual.

Okay, now, in the areas where you're position pacman, do you see the middle number, 0? You'll want to replace that with this code:

get ground height(1, X#, Z#)


What that will do is find the ground height of the matrix and place Pacman right above it.

Okay, now that the floor is all set up you just need to make it so that pacman can't leave the floor.

To do this you have to change this code:



So that it resembles this code:



This part is new: and (Z# or X#) (< or > (170 or 5) what this does is check to see if pacman is not near the edges of the matrix, and if he isn't then it allows him to walk around. Your code should now resemble this:



One thing that you'll notice is that some previous code I had you write will often change. The thing is is that I'm making the game better as I add new things, this often means changing things I created before. So bear with me. Next: Collision with blocks that will, in the future, make up our map.
Someone
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location: Australia
Posted: 9th Mar 2004 14:10
I've been scripting a unique 3D 1St Person view Pac Man over the last couple days, and I'm teachign myseld DBC as I go (I only know as much DBC as I've put in the game so far). ATM I'm up to placing the dots, so I'm sure this tut'll help.
Are you making this in DBC or DBP?
Cheers.

Call me Dean.
PC1: 2.0 Ghz AMD Athlon XP - 512 Meg DDR RAM - GeForce FX 5200, PC2: 0.5 Ghz P3 - 256 Meg SD RAM - GeForce2 MX 400, PC3: 2.5 Ghz P4 - 256 Meg DDR RAM - Integrated Video Card
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 9th Mar 2004 15:31
DBC, that's all I own. Yea, I was thinking of doing this in first person but decided to just do it overhead. I'm up to making the maps now and loading them in from arrays, but the next tutorial won't be here for a little while.
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 9th Mar 2004 21:30
how do i make my pacman look like the mouth is opening and closing?

Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 9th Mar 2004 21:45
That will take making an animated model of pacman, I'm no modeler, that's why I'm using just a sphere. If you can get an animated 3DS or .X model of pacman I can show you how to do it.
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 9th Mar 2004 22:02
does it need to be facing any certian direction?

diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 9th Mar 2004 22:13 Edited at: 9th Mar 2004 22:26
this is perfect it is exactly what i was wanting.thanks izzy545.i didn't want a first person.i wanted 2d and this will be perfect.could we maybe add two small spheres as eyes,texture them and lock them to object one?

please dont make fun of my spelling,or sentence structure.Id rather study math or programming
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 9th Mar 2004 22:32
Jason: No, it doesn't, you just rotate and position it however it needs to be.

Diablo fan: NP, and yes, we could do that, or you could just make a model of pacman that is textured to already have eyes and whatnot on it. Do you want me to show you how to do it the spheres way? BTW, next tutorial should be up by tonight.
diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 10th Mar 2004 07:49
im not good with models but i can try to make a pacman and a ghost and upload them to the code base.but i can't start until maybe thursday or friday if i do.

please dont make fun of my spelling,or sentence structure.Id rather study math or programming
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 10th Mar 2004 10:00
I've made the models justs havin trouble animating in 3D Canvas Pro.

diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 10th Mar 2004 17:35
i was just gonna suggest that we use spheres for the ghosts and pacman so we dont need outside media.and we add eyes with little spheres.size the ghosts a little larger with different colors.then we can do a short tutorial on adding in models when we are done.this way we can add it in the code base.

please dont make fun of my spelling,or sentence structure.Id rather study math or programming
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 10th Mar 2004 19:17
when will the next tut be done?

Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 10th Mar 2004 19:27 Edited at: 10th Mar 2004 19:32
Okay, reason this tutorial part has been taking so long is because I haven't been able to get the collision working right, and so, I'll make ammends to this code when I do get it right. Sometimes Pacman will get stuck in the walls on this one, which is VERY annoying. But yea, here we go...

First thing we have to do is make a cube object, this is exactly the same thing as doing pacman, but with a different command. This time, you'll use Make Object Cube. So type in this code:

Make object cube 2,8

These are fair sized cubes that will stand as our walls, I'm not going to go into making the entire map right now, because I'm not entirely finished with loading up the entire map, I'll just show you how to do a single block... One thing you'll have to do, is add in this line below our sphere code:

set object collision to spheres 1

What that does is set the object collision on spheres to object 1.

Then, under our cube code, add this:

set object collision to boxes 2

That does basically the same thing as the other but instead of spheres, sets it to boxes, and instead of object 1, sets it to object 2.

Now we have to position our cube onto the matrix. Type this below where we set the matrix up.

position object 2, 8, get ground height(1,8,8)-2, 8

That will set our object at X:8, Y:Ground height minus 2, Z:8.

Two new variables are needed for the collision. Before the main loop set these two variables:

PrevX# = 87
PrevZ# = 87


Next thing, is our movement needs total revamping, instead of typing it all in, I'll give you the commented code here:



Okay, that's our new movement code, at least part of it. Next thing you want is to check to see if those variables are set, and move accordingly. This will make it seem much more like a pacman type movement because when we press right pacman keeps going until he hits a wall, or we press another button.

For going right we must check to see if GoingRight is set to 1, and if it is, then we move accordingly. We also set PrevX# before moving, this will make sure that PrevX# is one behind us all the time. It also only allows us to move if Colliding is equal to 0.

Here's the code:

if GoingRight = 1 and X# < 170 and Colliding = 0 then PrevX# = X# : X# = X# + 1

See if you can figure out how to do all the others, if not then I'll show you at the end.

Now for object collision, once again, this is alot of code so I'm just going to give you the commented code on this one.



Alrighty, here's our completed code. Look in here if you couldn't figure out the movement bit.



BTW, you'll have to delete that code in the collision thing, or it will mess it up, that's why it's not there in the code up top.
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 10th Mar 2004 19:34
Well ****, could be a little while until next tutorial is up. I just lost all my setting up the level code I had done.
diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 11th Mar 2004 07:42 Edited at: 11th Mar 2004 07:55
thats ok my turn.i will give this a try.
first if you are useing this in dbpro with a good machine you will need to add this which i put at the begining before the loop:

sync rate 32

which will slow the pacman down then to hide the mouse:
hide mouse

the next part i added you guys can take out if you want but here it goes.i added eyes to him.




these are the eyes and i had to turn collision off on them or they would not touch the pacman.lets color them black.



next we need to mount them and make them follow pacman's every move
this part of the code i put inside the loop right before the collision commands.


xi and zi is the variable for one eye while zi1 and xi1 will be the other eye.finally the position object command this will go at the end of the loop before the sync command



well thats about all i can do like i said if you want to throw this out that ok.im still have alot to learn.back to you izzy and i hope im not messing this up.the final code would look like this
[/b][b][b][/b][u][/u]

please dont make fun of my spelling,or sentence structure.Id rather study math or programming
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 11th Mar 2004 07:45
No, no problem. I'm actually trying to get collision to work using nuclear glories freeware collision DLL, the older version, because it would make it much easier to do the collision I'm thinking, if only I knew how to get it to work...
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 11th Mar 2004 07:46
BTW, that's good you put that up, less work for me to do
diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 11th Mar 2004 07:49 Edited at: 11th Mar 2004 07:56
lol i cannot go any further, i dont know how i dont think and i dont have anymore time tonight.did you try the code? also i dont have the Vinal01.bmp so i changed it but i just changed it back so it will work now i hope.
i hope it still works in db ---its so funny when you run into the block his eyes pop out i like this---

please dont make fun of my spelling,or sentence structure.Id rather study math or programming
diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 11th Mar 2004 07:57 Edited at: 11th Mar 2004 07:58
i dont know what collision your having problems with.this tut is working great on my pc.

please dont make fun of my spelling,or sentence structure.Id rather study math or programming
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 11th Mar 2004 09:06
Hmm... Well, try walking into the block, and as you hit it press another key. You'll notice that occasionally you get caught in the walls, at least it happens to me...
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 11th Mar 2004 10:05
same prob

whats the next tut on? and when?

diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 11th Mar 2004 14:42
ok i didnt try hitting another button . i will try it tonight when i get home from work.i did have it print x# and z# to the screen when i was working on it and i noticed the coordinates are always whole numbers until you run into the block then they become float.it doesnt seem like that would affect it though.we could just do a math based collision.i have a snippet if we need it.

please dont make fun of my spelling,or sentence structure.Id rather study math or programming
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 11th Mar 2004 17:50
Okay... Next tut is making the level, basically using multiple correctly shaped objects which will be placed in certain positions...
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 11th Mar 2004 18:26
I'm making a 3D PacMan game. But my game is done from the 3RD person view. And i use mazes that are multiple stories...
So i don't think i could help much...

You know, when i see an old lady slip and fall on the side walk, my first instinct is to luagh, but then i think, what if i where an ant? and she fell on me, it just doesn't seem so funny anymore.
diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 11th Mar 2004 20:51 Edited at: 11th Mar 2004 23:35
as always im not home so i can't try this theory.but someone try this for a collision fix please:

--i just removed the first two they didnt work for crap--

im stumped.i will post a fix if i find one.

please dont make fun of my spelling,or sentence structure.Id rather study math or programming
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 11th Mar 2004 22:03
what does this do different than the normal code?

diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 11th Mar 2004 23:18
you two said you had collision problems so that is my try at fixing it.

please dont make fun of my spelling,or sentence structure.Id rather study math or programming
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 11th Mar 2004 23:20
Well, it doesn't work... Sorry. I still can't get NG Collision DLL to work either...
diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 11th Mar 2004 23:41 Edited at: 11th Mar 2004 23:58
i will get this .i have ideas

i got it

crap still buggy in db at least but it works great in dbpro
now its working good in both if it works for you guys then lets add more to the code



please dont make fun of my spelling,or sentence structure.Id rather study math or programming
diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 12th Mar 2004 00:02
i say its fixed need more walls to test it with where are you izzy?

please dont make fun of my spelling,or sentence structure.Id rather study math or programming
GameMaker Jason
20
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 12th Mar 2004 00:19
i've almost finish creating level1 of my game i'll post the code for you to use.

Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 12th Mar 2004 05:23
Mmk, I was originally making a level creator for this, but that turned out to be slow FPS wise because it had a box that size for each and every wall, so it ran very slowly. So I'll work on learning how to use static objects, then it should run much faster.
diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 12th Mar 2004 05:41 Edited at: 12th Mar 2004 05:42
here is the fix



i know its not totally perfect but this was very hard to figure out

please dont make fun of my spelling,or sentence structure.Id rather study math or programming
Izzy545
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location:
Posted: 12th Mar 2004 05:53
Sorry to break this to you, but there was a much easier way...

Here's the code I would have used to decrease the tedious task of making all those cubes...

for i = 2 to 22
make object box i,8,8, 40
color object i,rgb(255,0,0)
set object collision to polygons i
next i


that would of made all of those boxes.

Login to post a reply

Server time is: 2024-09-22 04:19:58
Your offset time is: 2024-09-22 04:19:58