Forum
O-Cman - Printable Version

+- Forum (https://www.boriel.com/forum)
+-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11)
+---- Forum: Gallery (https://www.boriel.com/forum/forumdisplay.php?fid=18)
+---- Thread: O-Cman (/showthread.php?tid=370)



O-Cman - oblo - 08-21-2011

Hi All

After a month of developing, I'm proud to release O-Cman, a Pacman clone for the ZX Spectrum. Their main features are:

- A nearly clone of the original arcade.
- Smooth animations
- Each ghost has its own IA
- Sounds, high score and several minor details regarding the original game.

Things that I think can improve the game (but I'm a bit 'lazy' to do them right now)

- Better IA for all the ghost
- Smooth animation for the eyes (I realize it too late)
- Different graphics for 'eatables' ghosts (I realize it too late too)

I hope you enjoy it as much I enjoyed making it. Please, feel free to send any comments, bugs, etc... I'll be grateful to see them Smile

Cheers


Re: O-Cman - LCD - 08-21-2011

Wow, thats what I really call "smooth"!!! Another great showroom project to show the power of ZXBC.


Re: O-Cman - oblo - 08-22-2011

Thanks! Here are a few screenshots:

[Image: ocman_01.jpg] [Image: ocman_02.jpg]

Cheers


Re: O-Cman - boriel - 08-22-2011

Tried it and it's absolutely amazing! Thank you for sharing :!:


Re: O-Cman - JBGV - 08-22-2011

Very good adaptation!

I like pac-man movement


Re: O-Cman - oblo - 08-23-2011

Thanks to all Smile Now I'm struggling between three projects for what my next game will be... this is addictive! :-D

Cheers


Re: O-Cman - britlion - 08-24-2011

Very nice indeed. Excellent work!

Preshifted sprites, using UDG.

Incidentally, if you are printing whole characters like this, you might find <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Putchars.bas">http://www.boriel.com/wiki/en/index.php ... tchars.bas</a><!-- m --> gets you a speed increase, since it should be faster than using the internal print routine - it's specialised to get blocks of data to the screen somewhat faster.

There are a couple of alternate screen handling routines in the library - the 2x2 fixed putblock is the fastest, but has limitations such as the size of the block. There's also an option to use the character based fourspriter, which has been encapsulated as a routine - but again, sprites are 2x2 - but the background is preserved.

<!-- l --><a class="postlink-local" href="http://www.boriel.com/forum/how-to-tutorials/topic397.html">how-to-tutorials/topic397.html</a><!-- l -->


On terms of Ghost AI - this might be useful to you: <!-- m --><a class="postlink" href="http://gameinternals.com/post/2072558330/understanding-pac-man-ghost-behavior">http://gameinternals.com/post/207255833 ... t-behavior</a><!-- m -->


Re: O-Cman - oblo - 08-25-2011

Thanks you very much britlion. Thisis an example that I have to dig more at the libraries in order to get all the benefits that the compiler offers. I'll try putchars, maybe the game gain the speed it needs, but one question: if UDGs are in an array, which is this case, how I point to them? The usage of putChars ask for a dataaddress (memory direction)
BTW, do you know any routine that preserve the background for 1x1 sprite?

Thanks and cheers

EDIT: I answer myself... a PEEK 23675 + 256*PEEK 23676 as dataaddress will do the trick, doesn't it?


Re: O-Cman - LCD - 08-25-2011

oblo Wrote:BTW, do you know any routine that preserve the background for 1x1 sprite?
This can be done with binary OR (BOR/|) and binary AND (BAND/&) with grabbing the background, puting a mask on in in memory using AND and puting sprite data in top of it using OR, then writing it back to screen memory, but real background preservation needs to store the whole background area in memory. It will be faster in ASM.


Re: O-Cman - boriel - 08-25-2011

Also remeber that OVER 1 does XOR, OVER 2 does AND and OVER 3 does OR ;-)
Read help on OVER: <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:OVER">http://www.boriel.com/wiki/en/index.php/ZX_BASIC:OVER</a><!-- m -->

AND + OR are used to create "Filmation Effects" (Alien 8, Knight Lore, Wally, etc)


Re: O-Cman - oblo - 08-25-2011

boriel Wrote:Also remeber that OVER 1 does XOR, OVER 2 does AND and OVER 3 does OR ;-)
Read help on OVER: <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:OVER">http://www.boriel.com/wiki/en/index.php/ZX_BASIC:OVER</a><!-- m -->

AND + OR are used to create "Filmation Effects" (Alien 8, Knight Lore, Wally, etc)

So, in theory, only using OVERs background can be preserved, right? At least for basic sprites.

Cheers

EDIT: or better, use this? <!-- l --><a class="postlink-local" href="http://www.boriel.com/forum/how-to-tutorials/topic390.html">how-to-tutorials/topic390.html</a><!-- l -->


Re: O-Cman - boriel - 08-25-2011

You should try OVER if using PRINT.
Otherwise, you can try your own sprite routines.