Author Topic: Need help for Bomberman  (Read 6153 times)

0 Members and 1 Guest are viewing this topic.

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Need help for Bomberman
« on: October 23, 2010, 01:26:34 pm »
Hello,

I'm having a little trouble with getting my enemies to die, and I can't die unless I touch them.  (As in my bombs won't kill me) Here's my source, and whoever helps will be put in the credits.  ;)  TIA!
Code: [Select]
:.BOMBRMAN AXE BomberMan! v1.0 by: Yunhua Z
:.TITLE
:[Pic1→Pic0T
:.CLEAR SPRITE
:[2288228822882288→Pic0C
:.BOMB SPRITE
:[0C103C4E5E7E7E3C→Pic1
:.BLANK SPACE
:[0000000000000000→Pic2A
:.DOTTED BLOCK
:[7EABD5ABD5ABD57E→Pic2
:.BREAKABLE BLOCK
:[7E81BDA1A1A1817E→Pic3
:.GUY LEFT
:[1C7E1222142A1436→Pic4
:.GUY RIGHT
:[387E48442854286C→Pic5
:.GUY FRONT/BACK
:[1C3E22143E081436→Pic6
:.EXPLODE Horizontal(
:[00FF55AAAA55FF00→Pic7
:.EXPLODE Vertical
:[5A665A665A665A66→Pic8
:.ENEMY FORWARD
:[3C4281A58181A55A→Pic9
:.ENEMY LEFT
:[1C2241514141552A→Pic0
:.ENEMY RIGHT
:[3844828A8282AA54→Pic10
:.ENEMY BACK
:[3C4281818181A55A→Pic11
:.CHERRIES
:[08182464B6FB6F06→Pic12
:.COIN
:[184218A5A5184218→Pic13
:.EXPLODE CENTER
:[5AE75AA5A55AE75A→Pic0E
:"GAME OVER→Str1
:"YOU WIN→Str2
:DiagnosticOff
:ClrDraw
:40→A
:Full
:Repeat K=54
:getKey→K
:If K=1 and (A=40
:48→A
:Pt-Off(22,40,Pic2A
:End
:If K=4 and (A=48
:40→A
:Pt-Off(22,48,Pic2A
:End
:Pt-On(22,A,Pic1
:DispGraph
:Pic0T→DispGraph
:End
:ClrDraw
:Normal
:If A=48
:."CREDITS:→Str3
:."THE OMNIMAGA COMMUNITY FOR SUPPORTING ME
:End
:If A=40
:0→X→Y→A→B→C→E
:16→Z→L
:88→G→{{L1}+1}
:56→D→{{L1}+2}
:For(L,0,11
:L*8→N
:For(M,0,7
:M*8→O
:Pt-On(N,O,Pic0C
:End
:End
:sub(BK
:Pt-Off(8,0,Pic0C
:Pt-Off(0,8,Pic0C
:0→θ→{{L1}+3}
:1→L
:Repeat K=15 or (L=0 or (L=42
:sub(DG
:.AI
:E+1→E
:If E^15=0
:Pt-Off({{L1}+1},{{L1}+2},Pic0C
:Pt-Off(G,D,Pic0C
:rand^2→I
:If I=1
:If {{L1}+1}>0 and (pxl-Test({{L1}+1}-7,{{L1}+2}+6)=0
:{{L1}+1}-(8*(rand^2))→{{L1}+1}
:8→{{L1}+3}
:End
:If G>0 and (pxl-Test(G-7,D+6)=0
:G-(8*(rand^2))→G
:8→θ
:End
:If {{L1}+1}<87 and (pxl-Test({{L1}+1}+9,{{L1}+2}+6)=0
:{{L1}+1}+(8*(rand^2))→{{L1}+1}
:16→{{L1}+3}
:End
:If G<87 and (pxl-Test(G+9,D+6)=0
:G+(8*(rand^2))→G
:16→θ
:End
:End
:If I=0
:If {{L1}+2}>0 and (pxl-Test({{L1}+1}+1,{{L1}+2}-2)=0
:{{L1}+2}-(8*(rand^2))→{{L1}+2}
:24→{{L1}+3}
:End
:If D>0 and (pxl-Test(G+1,D-2)=0
:D-(8*(rand^2))→D
:24→θ
:End
:If {{L1}+2}<55 and pxl-Test({{L1}+1}+1,{{L1}+2}+14)=0
:{{L1}+2}+(8*(rand^2))→{{L1}+2}
:0→{{L1}+3}
:End
:If D<55 and (pxl-Test(G+1,D+14)=0
:D+(8*(rand^2))→D
:0→θ
:End
:End
:If L=20
:254→G→D
:End
:If L=22
:254→{{L1}+1}→{{L1}+2}
:End
:Pt-Off({{L1}+1},{{L1}+2},Pic9+{{L1}+3}
:Pt-Off(G,D,Pic9+θ
:End
:If {{L1}+1}=X and ({{L1}+2}=Y
:0→L
:End
:If G=X and (D=Y
:0→L
:End
:.BOMB CHECK AND EXPLODE
:!If B=0
:A+1→A
:End
:If A=200
:Pt-Off(P,Q,Pic0E
:If pxl-Test(P+9,Q+2)=0
:Pt-Off(P+8,Q,Pic7
:If pxl-Test(P+17,Q+2)=0
:Pt-Off(P+16,Q,Pic7
:End
:End
:If pxl-Test(P-7,Q+2)=0
:Pt-Off(P-8,Q,Pic7
:If pxl-Test(P-15,Q+2)=0
:Pt-Off(P-16,Q,Pic7
:End
:End
:If pxl-Test(P+1,Q+10)=0
:Pt-Off(P,Q+8,Pic8
:If pxl-Test(P+1,Q+18)=0
:Pt-Off(P,Q+16,Pic8
:End
:End
:If pxl-Test(P+1,Q-6)=0
:Pt-Off(P,Q-8,Pic8
:If pxl-Test(P+1,Q-14)=0
:Pt-Off(P,Q-16,Pic8
:End
:End
:DispGraph
:Pause 100
:If (X-P≤16 or (P-X≤16)) and (Y=Q
:0→L
:End
:If (Y-Q≤16 or (Q-Y≤16)) and (X=P
:0→L
:End
:If G+8=P and (D=Q
:L+19→L
:End
:If G+16=P and (D=Q
:L+19→L
:End
:If G-8=P and (D=Q
:L+19→L
:End
:If G-16=P and (D=Q
:L+19→L
:End
:If G=P and (D+8=Q
:L+19→L
:End
:If G=P and (D+16=Q
:L+19→L
:End
:If G=P and (D-8=Q
:L+19→L
:End
:If G=P and (D-8=Q
:L+19→L
:End
:If {{L1}+1}=P+8 and ({{L1}+2}=Q
:L+22→L
:End
:If {{L1}+1}=P+16 and ({{L1}+2}=Q
:L+22→L
:End
:If {{L1}+1}=P-8 and ({{L1}+2}=Q
:L+22→L
:End
:If {{L1}+1}=P-16 and ({{L1}+2}=Q
:L+22→L
:End
:If {{L1}+1}=P and ({{L1}+2}=Q+8
:L+22→L
:End
:If {{L1}+1}=P and ({{L1}+2}=Q+16
:L+22→L
:End
:If {{L1}+1}=P and ({{L1}+2}=Q-8
:L+22→L
:End
:If {{L1}+1}=P and ({L1}+2}=Q-16
:L+22→L
:End
:End
:If A=250
:Pt-Off(P,Q,Pic0C
:Pt-Off(P-8,Q,Pic0C
:Pt-Off(P-16,Q,Pic0C
:Pt-Off(P,Q-8,Pic0C
:Pt-Off(P,Q-16,Pic0C
:Pt-Off(P+8,Q,Pic0C
:Pt-Off(P+16,Q,Pic0C
:Pt-Off(P,Q+8,Pic0C
:Pt-Off(P,Q+16,Pic0C
:.DispGraph
:0→A→B
:End
:.END BOMB SECTION
:!If L=0
:.KEYCHECK SERIES
:getKey→K
:If K=48 and (B=1
:199→A
:End
:If K=54 and (B=0
:8→C
:1→B
:X→P
:Y→Q
:Pt-On(P,Q,Pic1
:Pt-On(P,Q,Pic0C
:.DispGraph
:End
:If K=3 and (X<87 and (pxl-Test(X+10,Y+5)=0
:8→Z
:sub(CS
:X+8→X
:End
:If K=2 and (X>0 and (pxl-Test(X-6,Y+5)=0
:0→Z
:sub(CS
:X-8→X
:End
:If K=4 and (Y>0 and (pxl-Test(X+2,Y-3)=0
:16→Z
:sub(CS
:Y-8→Y
:End
:If K=1 and (Y<55 and (pxl-Test(X+2,Y+13)=0
:16→Z
:sub(CS
:Y+8→Y
:End
:Pt-Off(X,Y,Pic4+Z
:.DispGraph
:End
:End
:.WIN
:If L=42
:Output(1,1,Str2
:End
:.DIE ROUTINE
:!If L
:Output(0,0,Str1
:End
:Lbl CS
:.CLEAR ROUTINE
:Pt-Off(X,Y,Pic0C+C
:0→C
:.DispGraph
:Return
:.MAP
:Lbl BK
:For(O,1,7
:O*8→T
:O+1→O
:For(N,0,11
:8*N→V
:If rand^5≠0
:Pt-Off(V,T,Pic3
:End
:End
:End
:For(N,0,11
:8*N→V
:N+1→N
:For(O,1,7
:O*8→T
:If rand^5≠0
:Pt-Off(T,V,Pic3
:End
:End
:End
:Return
:Lbl DG
:For(N,1,10
:N+1→N
:N*8→R
:For(O,1,6
:O+1→O
:O*8→S
:Pt-Off(R,S,Pic2
:End
:End
:DispGraph
:Return
:.Lbl BK
:.For(M,1,11
:.M*8→T
:.M+1→M
:.For(U,1,7
:.U*8→V
:.U+1→U
:.Pt-On(T,V,Pic3
:.End
:.End
:.StorePic
:.DispGraph
:.Return
:End
:
Generated by SourceCoder (http://sc.cemetech.net)
© 2005-2010 Cemetech (http://www.cemetech.net)
« Last Edit: October 27, 2010, 03:12:34 pm by yunhua98 »

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: Need help for Bomberman
« Reply #1 on: October 23, 2010, 02:35:17 pm »
I made improvements in your code and found mistakes you made. It could be the solution. ^-^
Code: [Select]
:If G+8=P or (G+16=P or (G-8=P or (G-16=P
:If D=Q
:sub(L19
:End
:End
:
:If D+8=Q or (D+16=Q or (D-8=Q or (D-16=Q
:If G=P
:sub(L19
:End
:End
:
:If {{L1}+1}=(P+8) or ({{L1}+1}=(P+16) or ({{L1}+1}=(P-8) or ({{L1}+1}=(P-16
:If  ({{L1}+2}=Q
:sub(L22
:End
:End
:
:If ({{L1}+2}=(Q+8) or ({{L1}+2}=(Q+16) or (({{L1}+2}=(Q-8) or (({L1}+2}=(Q-16
:If {{L1}+1}=P
:sub(L22
:End
:End
:
:Lbl L19
:L+19->L
:Return
:
:Lbl L22
:L+22->L
:Return

Instead of:

Code: [Select]
:.SCROLL DOWN TO SEE WHERE I MARK THE MISTAKES :P
:If G+8=P and (D=Q
:L+19→L
:End
:If G+16=P and (D=Q
:L+19→L
:End
:If G-8=P and (D=Q
:L+19→L
:End
:If G-16=P and (D=Q
:L+19→L
:End
:If G=P and (D+8=Q
:L+19→L
:End
:If G=P and (D+16=Q
:L+19→L
:End
:If G=P and (D-8=Q
:L+19→L
:End
:If G=P and (D-8=Q . HERE, YOURE USING THIS BOOLEAN A SECOND TIME =D
:L+19→L
:End
:If {{L1}+1}=P+8 and ({{L1}+2}=Q
:L+22→L
:End
:If {{L1}+1}=P+16 and ({{L1}+2}=Q
:L+22→L
:End
:If {{L1}+1}=P-8 and ({{L1}+2}=Q
:L+22→L
:End
:If {{L1}+1}=P-16 and ({{L1}+2}=Q
:L+22→L
:End
:If {{L1}+1}=P and ({{L1}+2}=Q+8 . (Q+8) ! OTHERWISE THE BOOLEAN WOULD BE {{L1}+2}=Q, AND 8 WILL BE ADDED TO THE RETURNED 1 OR 0, WHAT LET THE BOOLEAN BE ALWAYS TRUE D:
:L+22→L
:End
:If {{L1}+1}=P and ({{L1}+2}=Q+16 . (Q+16)
:L+22→L
:End
:If {{L1}+1}=P and ({{L1}+2}=Q-8 . (Q-8)
:L+22→L
:End
:If {{L1}+1}=P and ({L1}+2}=Q-16 . (Q-16)
:L+22→L
:End
« Last Edit: October 30, 2010, 12:06:49 pm by Aichi »

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Need help for Bomberman
« Reply #2 on: October 23, 2010, 04:55:06 pm »
Thanks!  I think thats why it isn't killing the ghost  ;)

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Need help for Bomberman
« Reply #3 on: October 23, 2010, 08:39:09 pm »
Ahh, code in a spoiler tag! The mortal enemy of Chrome users!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Need help for Bomberman
« Reply #4 on: October 23, 2010, 10:19:12 pm »
Yeah I wish the mod author would fix that X.x. Fortunately you can CTRL+A/C inside it then CTRL+V elsewhere, though

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Need help for Bomberman
« Reply #5 on: October 27, 2010, 03:13:28 pm »
Ahh, code in a spoiler tag! The mortal enemy of Chrome users!

oops.  :-[  fixed.

btw, that fix did not work, any more help?  TIA  ;)

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Need help for Bomberman
« Reply #6 on: October 29, 2010, 05:28:26 pm »
*bump*

EDIT:  actually, nvm, I think I got it.  ;)

Yayz!  I figured it out, it was what Aichi pointed out plus one more thing with the logic.  :D
« Last Edit: October 29, 2010, 05:33:43 pm by yunhua98 »

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Need help for Bomberman
« Reply #7 on: October 29, 2010, 11:05:54 pm »
Glad to hear you got it working :D

As for logic was it one of those inverted > or < symbol? :P

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Need help for Bomberman
« Reply #8 on: October 30, 2010, 07:39:22 am »
No, it was a variable I typed wrong plus the problem aichi showed me. ;)

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Need help for Bomberman
« Reply #9 on: October 30, 2010, 02:44:47 pm »
Ah ok I see, because inverted logic symbol is something that often happens to me X.x