DIV ARENA FORUMS

New-Pacman: arcade and multiplayer

josepgames - 31-10-2016 at 02:45 PM

Hi people!!

I send you a game I developed at 2002 recompiled under Div DX, everything works flawless except for the music (once compiled it doesn't work and I don't know why).

This new-pacman game is an evolution of the original Pac-Man game with an arcade mode and the possibilty to play with 2 players at half screen. It also includes a level editor so that you can create an add further levels to it.

Enjoyt!!

[Edited on 31-10-2016 by josepgames]

pac1.jpg - 55kB pac2.jpg - 20kB pac3.jpg - 22kB pac4.jpg - 51kB pac5.jpg - 27kB

[Edited on 31-10-2016 by josepgames]

Attachment: newpacmanDIVDX.zip (460kB)
This file has been downloaded 2706 times

[Edited on 31-10-2016 by josepgames]

Attachment: newpacmanDIVDX.z02 (5MB)
This file has been downloaded 2685 times

[Edited on 31-10-2016 by josepgames]

Attachment: newpacmanDIVDX.z01 (5MB)
This file has been downloaded 2716 times


MikeDX - 31-10-2016 at 02:55 PM

For the music to work you need to copy libmikmod from div/system to your exe folder then it should work :)

MikeDX - 31-10-2016 at 03:04 PM

This zip also does not extract :(

MikeDX - 31-10-2016 at 09:51 PM

Ok after some juggling I got this to work! :)

josepgames - 31-10-2016 at 10:08 PM

I had to split zip into three files in order to upload it (max filesize is 5mb), I think this is why it didn't uncompress properly.

I'll try to fix the music as you said! Many thnks!!

MikeDX - 31-10-2016 at 10:59 PM

Thanks to your pacman game I have fixed a bug in DIV's fopen function which was preventing files from loading from the correct locations. :)

It runs great here on linux. I will try to make a web version now.

MikeDX - 31-10-2016 at 11:43 PM

The web version sort of works until the game starts and then has a problem

http://js.mikedx.co.uk/newpac.html

I should be able to fix this bug soon!

josepgames - 1-11-2016 at 07:00 AM

Wow! Awesome! Thanks! I'll wait for the bug to be fixed

josepgames - 2-11-2016 at 10:30 AM

Hi Mike,

I've been testing the New PacMan versions, Web version and Compiled version from DIV interface.

Web version
--------------

Hungs just before beggining the first level. I think the error is because it's unable to load music file

Compiled Version
---------------------

Once finishing any level game hungs. When finishing a level, raises an animation which spins the screen by copying last rendered frame. I attach the code that hangs, I suspect it's on xput or screen_copy functions. Should I report it at other section?


Code:
mapa_fin = new_map(640,480,640/2,480/2,0); if (jugadores==2 && ganador == _JUGADOR2) screen_copy(REGION_CELDA2,0,mapa_fin,-640/2,-480/2,640,480); else screen_copy(REGION_CELDA,0,mapa_fin,-640/2,-480/2,640,480); end frame; angle = 0; size = 100; xput(0,mapa_fin,640/2,480/2,angle,size,0,0); let_me_alone(); stop_scroll(SCROLL_CELDA); stop_scroll(SCROLL_CELDA2); frame; i_aux = 0; i_aux2 = rand(1,2); i_aux3=0; repeat screen_copy(0,0,mapa_fin,-640/2,-480/2,640,480); angle+=1000; i_aux++; if (i_aux>10) i_Aux = 0; if (i_aux2==1) size--; else size++; end end if (i_aux3>130) fade(0,0,0,3); end i_aux3++; xput(0,mapa_fin,640/2,480/2,angle,size,0,0); frame; until(i_aux3>230) clear_screen(); fade(100,100,100,5); nivel_actual++;

Thanks!


MikeDX - 2-11-2016 at 10:33 AM

The problen with he web version is the file name, you use string manipulation to get the filename:

Filename--:
Filename+".ext";

This causes the name to be ext/.ext instead of ext/nivelN.ext


I don't seem to be able to fix this

Haven't been able to find any other bug yet though, the linux prg conpiled works fine.


josepgames - 2-11-2016 at 10:40 AM

Ok, I can try to replace the string manipulations. I this case:
Code:
nivel_a_cargar--; nivel_a_cargar+=".nwp"; fd_file = fopen(_DIRECTORIO+"nwp\"+nivel_a_cargar,"r");

Should this work at web version?:
Code:
nivel_a_cargar--; fd_file = fopen(_DIRECTORIO+"nwp\"+nivel_a_cargar+".nwp","r");


And for the second bug, I'll try to run game in linux and I'll see if I reproduce error. However, I could delete that animation if that's the problem in Windows...

Thanks for your time!!

MikeDX - 2-11-2016 at 11:02 AM

With modern div you don't even need the directory name. Div looks in prg dir and prgdir/ext/

E.g.

Graf.fpg will look in:

Prg/graf.fpg
Prg/fpg/graf.fpg


And then

Divdir/graf.fpg and
Divdir/fpg/graf.fpg

I'm not sure if your fix will work. I think its the line nivel_a_cargar-- that breaks it, but i can't seem to work out why.

Not many prgs have used fopen that I've tested, they have relied on simple load() and save() functions


josepgames - 3-11-2016 at 03:26 PM

Hi Mike,

I send you a new version changing the directory string substitution to check if this way works with web section. Could you try it again?

I'm still trying to fix end level error on windows.

Thanks!

Attachment: newpacman.z01 (5MB)
This file has been downloaded 3001 times

[Edited on 3-11-2016 by josepgames]

Attachment: newpacman.z02 (5MB)
This file has been downloaded 2995 times

Attachment: newpacman.zip (2.2MB)
This file has been downloaded 3043 times

[Edited on 3-11-2016 by josepgames]