You are not logged in.
Pages: 1
while learning c++ i started writing this little game - first using allegro, then a rewrite with directx, now a quick and dirty port to linux using sdl.
* pacman clone
* skinable
* level editor included
pacman usage:
commandline arguments
--help: show this message
--level <lvl>: start with selected level
--skin <skin>: start with selected skin
--editor <lvl>: start in editor mode.
if a levelname is given the editor loads and saves to that level
ingame
esc/q: quit
arrows: movement
space: boost
p: toggle pause
n: new game
l: switch level
s: switch skin
e: enter editor
w: (in editor) save map
f: toggle fps display
h: view highscorethe game is in a playable state - but there is tons of room for improvement und it's not exactly userfriendly ![]()
an editor is included but it suffered alot during the transition from having a menubar in windows to not having a menubar in linux (couldn't find a good way to do this using sdl)
the most urgent issues would be
* improve performance on lowend pcs
* compile this for windows ( and iphone and android and windows mobile and make tons of cash
)
* making the paths to image/config/sound files err.. a little less sensitive (atm you will get a segmentation fault if you don't start the game from the pacman root dir).. this should be very simple.
* make the level editor easier to use .. at the moment it's a pain
install:
* this is now available as a PKG called pacman_sdl in the AUR, see below for link
AUR:
http://aur.archlinux.org/packages.php?ID=28014
github:
http://github.com/schuay/pacman/tree/master
git://github.com/schuay/pacman.git
windows version:
http://github.com/schuay/pacman/downloads
if anybody likes the game, great. if somebody improves on it, awesome. if nobody cares, no harm done ![]()
Last edited by schuay (2009-07-19 20:31:54)
Offline
just tried this out.. nice job ![]()
ARCH|awesome3.0 powered by Pentium M 750 | 512MB DDR2-533 | Radeon X300 M
The journey is the reward.
Offline
+1 to above. Your binary is 32-bit, and there's no Makefile in sight? I see a CodeBlocks workspace file, but without CodeBlocks?
Last edited by Ranguvar (2008-11-22 03:05:22)
Offline
edit: makefile + pkgbuild are now included in the first post
here you go.. hope it works for you, first time writing a makefile ![]()
CC=g++
SOURCES=Settings.cpp Pacman.cpp Main.cpp Log.cpp hScore.cpp Ghost.cpp Game.cpp Error.cpp BckgrObj.cpp BHeap.cpp App.cpp
OBJECTS=Settings.o Pacman.o Main.o Log.o hScore.o Ghost.o Game.o Error.o BckgrObj.o BHeap.o App.o
LIBS=-lSDL_ttf -lSDL_gfx
EXECUTABLE=pacman_v4
all:
$(CC) -c `sdl-config --cflags` $(SOURCES)
$(CC) `sdl-config --libs` $(LIBS) $(OBJECTS) -o $(EXECUTABLE)
clean:
rm -f $(OBJECTS)
uninstall:
rm -f $(EXECUTABLE)Last edited by schuay (2008-11-22 11:23:45)
Offline
Nice work with this, maybe you should host it on a GitHub account so people can fork
Done! The link is in the first post.
Offline
omg.. i thought "huh? sdl package management?"
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
Added to AUR at http://aur.archlinux.org/packages.php?ID=28014
Might do some more work on this soon!
( Sorry for bumping my old post
)
Edit: Enabled sound and fixed transparency issues.
Last edited by schuay (2009-07-05 15:29:36)
Offline
Hey, nice game.
I'm writing something similar in SDL and was wondering how you did the AI for the ghosts, what kind of algorithm did you use?
Offline
+1
It's really nice new revision of well-known old games, and much faster than the 3d version of it.
Thank you for everything!
Offline
I'm glad you liked it, thanks for trying it out ![]()
I'm writing something similar in SDL and was wondering how you did the AI for the ghosts, what kind of algorithm did you use?
I wrote most of this a loong time ago and I can't remember most of the implementation details. But the source code is available here: http://github.com/schuay/pacman/tree/master
The AI is contained in Ghost.cpp, take a look at the pathCalcNormal, pathCalcVuln, and pathCalcDead functions.
Edit:
It's pretty primitive actually. During the loop, a specific location is set as the target for the ghosts. 2 of them are set to pacmans current location, the other 2 to pacmans next intersection.
Every time a ghost reaches an intersection, it has a certain chance of NOT choosing the fastest way to its target location. This chance goes down the closer it is to its target, so once a ghost is hot on your tail, there's a good possibility that it will keep chasing you instead of wandering off. Pathfinding is done with a bheap, the logic for that is partly in Ghost.cpp and the implementation of the bheap itself is in BHeap.cpp.
Last edited by schuay (2009-07-11 13:35:16)
Offline
Pages: 1