### Author Topic: Correction Code  (Read 1327 times)

0 Members and 1 Guest are viewing this topic.

#### hellninjas

• LV7 Elite (Next: 700)
• Posts: 625
• Rating: +17/-0
##### Correction Code
« on: May 09, 2012, 11:23:51 am »
It's me again, still trying to figure out bullets. I received some help form Derf, and it was very helpful, I feel that I am very close to figuring this out!
But I have a problem, I can't figure out what's wrong with this code, as it does not work for me...
Below is the code I received from Derf, if you could help me, it would be much appreciated
Code: [Select]
0->Grepeat getkey(15)DispgraphClrdrawFor(G,1,I)               //Repeat code for every bulletPxl-Off{L1+(G*4)},{L1+(G*4)+1})      //Turn display for bullet offIf {L1+(G*4)+2}=1:{L1+(G*4)+1}-1->{L1+(G*4)+1}               //Depending on what direction bullet has, move it that wayEndIf {L1+(G*4)+2}=2:{L1+(G*4)}+1->{L1+(G*4)}EndIf {L1+(G*4)+2}=3:{L1+(G*4)+1}+1->{L‚+(G*4)+1}EndIf {L1+(G*4)+2}=4:{L1+(G*4)}-1->{L1+(G*4)}End:EndFor(G,1,I)                                                   //Repeat code for every bulletIf pxl-Test({L1+(G*4)},{L1+(G*4)+1})            //If hits a lit up pixel (wall), move coordinates to 0,0 (storage)0->{L1+(G*4)}->{L1+(G*4)+1}ElsePxl-On({L1+(G*4)},{L1+(G*4)+1})              //Otherwise, turn the bullet back onEnd
I'm not entirely sure why this isn't working...
« Last Edit: May 09, 2012, 12:06:56 pm by hellninjas »

#### Sorunome

• Fox Fox Fox Fox Fox Fox Fox!
• Support Staff
• LV13 Extreme Addict (Next: 9001)
• Posts: 7917
• Rating: +373/-13
• Derpy Hooves
##### Re: Correction Code
« Reply #1 on: May 09, 2012, 11:51:51 am »
Aren't there some ends missing at the end of the code? (two i think)
 THE GAMEAlso, check out my websiteIf OmnomIRC is screwed up, blame me!Click here to give me an internet!

#### hellninjas

• LV7 Elite (Next: 700)
• Posts: 625
• Rating: +17/-0
##### Re: Correction Code
« Reply #2 on: May 09, 2012, 11:56:18 am »
I have those in my code, I guess I forgot to type them

#### Derf321

• LV3 Member (Next: 100)
• Posts: 59
• Rating: +0/-0
##### Re: Correction Code
« Reply #3 on: May 11, 2012, 05:02:20 pm »
You need:

GetKey → K   //Should have this at start of program loop
If K=1          //If key pressed is down
1 → {L1+(G*4)+2}  //Store 1 to that bullets direction variable
End
If K=2.... etc.

#### kindermoumoute

• Posts: 836
• Rating: +54/-3
##### Re: Correction Code
« Reply #4 on: May 11, 2012, 06:22:05 pm »
You need:

GetKey → K   //Should have this at start of program loop
If K=1          //If key pressed is down
1 → {L1+(G*4)+2}  //Store 1 to that bullets direction variable
End
If K=2.... etc.
Code: [Select]
GetKey!If -1.getKey=1Else!If -1.getKey=2Else!If -1.getKey=3...
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%

#### squidgetx

• Food.
• CoT Emeritus
• LV10 31337 u53r (Next: 2000)
• Posts: 1881
• Rating: +503/-17
• rawr.
##### Re: Correction Code
« Reply #5 on: May 14, 2012, 10:31:44 pm »
You should just be using getKey() instead of the BASIC-style getKey->var

#### hellninjas

• LV7 Elite (Next: 700)
• Posts: 625
• Rating: +17/-0
##### Re: Correction Code
« Reply #6 on: May 15, 2012, 07:46:19 am »
It's all in but I still can't get it to work ;.;