|
-
May 21st, 2010, 06:31 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] What is wrong with my code? Make eneies shoot....
Okay. I got only the left side to shoot.... But, the code i have set up should make both the left and right side shoot.... Also, only one enemy should shoot when it starts, but all 6 do! Here is my code:
Code:
If sn = 20 And noes <> Difficulty + 1 And noes <> 12 And noes < Difficulty + 1 Then
Dim temparr2
For temparr2 = 0 To enemyleftnum - 1
If noes >= Difficulty + 1 Or noes = 12 Then
Exit For
End If
If enemyleftstatus(temparr2) = "Alive Left" And enemyleft(temparr2) >= 0 And enemyshotstatusl(temparr2) = "" Then
enemyleftstatus(temparr2) = "Shoot Left"
noes = noes + 1
enemyshotstatusl(temparr2) = "Shoot"
End If
If noes >= Difficulty + 1 Or noes = 12 Then
Exit For
End If
Dim temparr3
For temparr3 = 0 To enemyrightnum - 1
If EnemyrightStatus(temparr3) = "Alive Right" And enemyright(temparr3) <= 269 And enemyshotstatusr(temparr3) = "" Then
EnemyrightStatus(temparr3) = "Shoot Right"
noes = noes + 1
enemyshotstatusr(temparr3) = "Shoot"
Exit For
End If
Next temparr3
Next temparr2
End If
I also attached the project as well... Please help me!
Last edited by Gamemaster1494; May 22nd, 2010 at 07:44 PM.
-
May 21st, 2010, 09:56 PM
#2
Re: What is wrong with my code? Make eneies shoot....
I would think you'd want to unnest the second for/next loop.
I don't see why you'd want to loop the right enemies while inside the loop for the left enemies.
Software I use and highly recommend: Opera, Miranda IM, Peerblock, Winamp, Unlocker Assistant, JoyToKey, Virtual CloneDrive, Secunia PSI, ExplorerXP, GOM Player, Real Alternative, Quicktime Alternative,Sumatra PDF, and non-freeware: Photoshop and VB6( ).
My codebank: AllRGB, Rounded Rectangle(math), Binary Server, Buddy Paint, LoadPictureGDI+, System GUID/Volume Serial, HexToAsc, List all processes and their paths, quasiString matching
Strings(search, extraction, retrieval etc): Retrieve BBCode Link from HTML, RemoveBetween ()'s, strFindBetween(str1,str2), Insert text in HTML, HTML - GetSpanByID
-
May 21st, 2010, 10:46 PM
#3
Thread Starter
Fanatic Member
Re: What is wrong with my code? Make eneies shoot....
becuase if a shot for the left enemy is made, then make sure if there is room for a shot by the right....
-
May 22nd, 2010, 02:06 AM
#4
Re: What is wrong with my code? Make eneies shoot....
I made the right side enemies shoot use:
vb Code:
Dim temparr3
For temparr3 = 0 To enemyrightnum - 1
If EnemyrightStatus(temparr3) = "Alive Right" And enemyright(temparr3) >= 0 And enemyshotstatusr(temparr3) = "" Then
EnemyrightStatus(temparr3) = "Shoot Right"
noes = noes + 1
enemyshotstatusr(temparr3) = "Shoot"
Exit For
End If
Next temparr3
That is replacing:
with
Is that what you want?
Edit:
I am currently seeing how to solve the other issue you mentioned above. Although, I'm having a difficult time knowing which code does what. It would be a good idea to significantly increase the amount of comments in your code so that people helping you know what does what in your program.
Last edited by Nightwalker83; May 22nd, 2010 at 03:04 AM.
Reason: Adding more!
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
May 22nd, 2010, 11:20 AM
#5
Thread Starter
Fanatic Member
Re: What is wrong with my code? Make eneies shoot....
XD I found one problem... This is for the right:
Code:
Dim temparr3
For temparr3 = 0 To enemyrightnum - 1
If EnemyrightStatus(temparr3) = "Alive Right" And enemyright(temparr3) <= 296 And enemyshotstatusr(temparr3) = "" Then
EnemyrightStatus(temparr3) = "Shoot Right"
noes = noes + 1
enemyshotstatusr(temparr3) = "Shoot"
Exit For
End If
Next temparr3
By changing this :
To:
xD
Now all that is left is to have it stop shooting 12 all the time.... only 2 at first, then 3 for level 2, then 4 for 3, then 5 for 4, and so on, till level 13 and on its always 12....
Last edited by Gamemaster1494; May 22nd, 2010 at 11:31 AM.
-
May 22nd, 2010, 07:43 PM
#6
Thread Starter
Fanatic Member
Re: What is wrong with my code? Make eneies shoot....
lol. i found out what was wrong. for some odd reason, it was making noes = -72 and such. XD thanks though.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|