A Pacman game?

Started by SilverWizard_OTF, Mon 05/07/2004 10:51:12

Previous topic - Next topic

SilverWizard_OTF

Well, i would like any hints about making a pacman-style game.
Moving the character with the keyboard is something that i always wanted to do.

Also, an arcade game like Super Mario woulbe be wonderful if it could be created with AGS.

Thanks for you time.
"All we have to decide is what to do, with the time that is given to us"

Barbarian

Search the forums and I'm sure you'll find lots of useful tips to help you. I'm sure you could code something like a PacMan type of game using AGS.
  For an example of a great little platformer type of game made with AGS, see this link:

http://www.agsforums.com/yabb/index.php?topic=14277.0

And, in the meantime, here's a snippet of scripting code that may help you (see below),  I think I got from one of the AGS resource sites.. It gives an example of how to move a character Up, Down, Left, Right by using the arrow keys on the keyoard.

* Below is the example of script code:

I will only show how to make Up, Down, Left and Right...but the ideas can be applied to corner keys pretty easily. First open your Global Script (Ctrl+G). Scroll down to the on_key_press function which will have a list of a bunch of if(keycode==blah) blah blah...so on and so forth. Just to try a little shock therapy I'm just gonna give the script in whole...


if (keycode==372) { // up arrow
    MoveCharacterStraight(EGO, player.x, player.y-200);
    while ((IsKeyPressed(372)>0) && (character[EGO].walking)) Wait(1);
    StopMoving(EGO);
}

if (keycode==375) { // left arrow
    MoveCharacterStraight(EGO, player.x-200, player.y);
    while ((IsKeyPressed(375)>0) && (character[EGO].walking)) Wait(1);
    StopMoving(EGO);
}

if (keycode==377) { // right arrow
    MoveCharacterStraight(EGO, player.x+200, player.y);
    while ((IsKeyPressed(377)>0) && (character[EGO].walking)) Wait(1);
    StopMoving(EGO);
}

if (keycode==380) { // down arrow
    MoveCharacterStraight(EGO, player.x, player.y+200);
    while ((IsKeyPressed(380)>0) && (character[EGO].walking)) Wait(1);
    StopMoving(EGO);





Conan: "To crush your enemies, see them driven before you, and to hear the lamentation of the women!"
Mongol General: "That is good."

Blade of Rage: www.BladeOfRage.com

Ashen

Keyboard control Tutorial:
http://www.sylpher.com/TutScriptsWalk.html

Platformerius: The Ninja Incident (AGS-based Platform demo)
http://www.agsforums.com/games.php?action=detail&id=220

Another AGS-based platform demo
http://www.agsforums.com/yabb/index.php?topic=13052.0

Are these any use? I used the first to make a Pacman-style mini-game for something I was working on, before I realised I'd put more effort into it than the full game. Neither of them got finished.

The other 2 show what's possiblewith AGS for arcade/platform style games.

EDIT: Damn, Barbarian beat me to it while I was looking up the links. Oh, well...
I know what you're thinking ... Don't think that.

SilverWizard_OTF

Thanks barbarian, your code worked perfectly!
Thank you too Ashen, for your links.

One last question: Any idea of how will make a "jumping" action
(Like to a Super Mario game, where you press B and one of the arrows, and the character jumps to that direction)?

Anyway, thank you again. Your help was very valuable.

"All we have to decide is what to do, with the time that is given to us"

Scummbuddy

I know that the latest version of ags has:
* Added character[].z variable, to allow you to make a character levitate into the air whilst still using the baseline, light levels and interactions of its Y co-ordinate.

which should help in making a jumping character
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

SilverWizard_OTF

ScummyDead, could you be more specific please? Can you post this code that you are talking about?
"All we have to decide is what to do, with the time that is given to us"

TerranRich

He's not talkng about specific code, he just mentioned a variable you can use IN your code. If you need help with scripting, check out the sticky thread in this subforum to find more resources for scripting.

As always, we suggest that you try out a simple, regular, plain old adventure game first before trying unconventional games in AGS. :) It's a lot easier that way and helps you to learn a lot better.
Status: Trying to come up with some ideas...

Dorcan

I hope you have experience in scripting, or you have the motivation to learn, because it could be really difficult to achieve otherwise :-\ If you want to make a Pacman game, I you need to script the AI, and maybe a map generator too.


I'm actually working on the pathfinding algorithm for a bomberman game, and I alread have done the map editor. I think I will make a template from it when it's finished.

Just in case you would find it usefull  :)

SilverWizard_OTF

Thank you Dorkan. Yes, i think i will find this template useful. Please let me know when you will have it ready.

And Moebius,  of course first of all we should use AGS for adventure-games.  But  when someone tries to make something that officially it is not supported (like an  pac-man game with AGS) he could learn more things from his trials.

Personally, i use only basic script functions.  If there is a tutorial from which i can learn to make an advance AI or a map generator,  please let me know.

In a pac-man game a script command "FollowPlayerCharacter" to the monster-character can work perfectly, can't  it ?"
"All we have to decide is what to do, with the time that is given to us"

TerranRich

Yeah, but if you stop, the enemy also stops. Not very useful. :P
Status: Trying to come up with some ideas...

SilverWizard_OTF

I didn't thought that! Any other opinion about making the monsters?
  (One good idea is the monsters to be controlled by another players!)
"All we have to decide is what to do, with the time that is given to us"

Dorcan

erm no, I don't think it's a good idea... it wouldn't be Pacman anymore

SMF spam blocked by CleanTalk