0 Members and 2 Guests are viewing this topic.
:.The sprite.:[FCFC000000000000]-> Pic2:For(V,0,5):0->{V*4+L5}:End
:25->S->T
:Repeat getkey(15):If getKey(54):For(V,0,5):If T=S:.Checks if T=S so that the bullets are spaced out:!If {V*4+L5}:.If the bullet check is 0...
:.Change bullet check:1->{V*4+L5}:.Turns T back to 0 and it will have to go back up to 25 (S) to fire again:0->T:.Exits this loop now since we already have our bullet:Goto X:End:End:End:End:Lbl X
:For(V,0,5):If {V*4+L5}=1:.If bullet check = 1:.Set the coordnates of the player to the bullet:X->{V*4+L5+1}:Y->{V*4+L5+2}:.Put it on the screen:Pt-On({V*4+L5+1},{V*4+L5+2},Pic2:.Turn on the bullet check to 2 now.:2->{V*4+L5}:.You should have a variable that tells if the character is left or right. Save that to the bullet like as shown here:R->{V*4+L5+3}:End:End
:For(V,0,5):If {V*4+L5}=2:.Checks if the bullet check is 2...:If {V*4+L5+3}:.If facing right..:{V*4+L5+1}+2->{V*4+L5+1}:Else:.If its not,:{V*4+L5+1}-2->{V*4+L5+1}:End:.Show the bullet:Pt-On({V*4+L5+1},{V*4+L5+2},Pic2):End:End
:For(V,0,5):If {V*4+L5+1}>90:.If the bullet is off the screen (Works for both left and right side):.Set the bullet checks back to zero and put the coordnates off the screen to not interfere:0->{V*4+L5}+100->{V*5+L5+1}->{V*5+L5+2}:.Now the bullet check is back to zero to start the cycle over again.:Return:End:End
:.Make T move up to S for the bullet spacing:If T < S:T++ :End
:For(V,0,5):.Collision detect:If abs({V*4+L5+1}-A)<6:If abs({V*4+L5+2}-B)<6:. I'll use C for the enemy's health:C--:0->{V*4+L5}+100->{V*5+L5+1}->{V*5+L5+2}:. The same thing as before, to reset the bullet:End:End:End
:For(V,0,5):For(P,0,3):. Has to check a For( for the enemies and the bullets:. Collision detectIf abs({V*4+L5+1}-{P*2+L1})<6If abs({V*4+L5+2}-{P*2+L1+1})<6:. I'll use P+L2 as the enemy's health:{P+L2}--:. Remove one from the health:0->{V*4+L5}+100->{V*5+L5+1}->{V*5+L5+2}:. Bullet resetEndEndEndEndEnd
:[FCFC000000000000]->Pic2:For(V,0,5):0->{V*4+L5}:End:25->S->T:Repeat getkey(15):ClrDraw:If getKey(54):For(V,0,5):If T=S:!If {V*4+L5}:1->{V*4+L5}:0->T:Goto X:End:End:End:End:Lbl X:For(V,0,5):If {V*4+L5}=1:X->{V*4+L5+1}:Y->{V*4+L5+2}:Pt-On({V*4+L5+1},{V*4+L5+2},Pic2:2->{V*4+L5}:R->{V*4+L5+3}:End:End:For(V,0,5):If {V*4+L5}=2:If {V*4+L5+3}:{V*4+L5+1}+2->{V*4+L5+1}:Else:{V*4+L5+1}-2->{V*4+L5+1}:End:Pt-On({V*4+L5+1},{V*4+L5+2},Pic2:End:End:For(V,0,5):If {V*4+L5+1}>90:0->{V*4+L5}+100->{V*5+L5+1}->{V*5+L5+2}:Return:End:End :If T < S:T++:End:For(V,0,5):For(P,0,3)If abs({V*4+L5+1}-{P*2+L1})<6If abs({V*4+L5+2}-{P*2+L1+1})<6:{P+L2}--:0->{V*4+L5}+100->{V*5+L5+1}->{V*5+L5+2}EndEndEndEndEndDispGraphEnd