﻿ Correction Code
22 May, 2013, 00:45:30
 OmnomIRC You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

 Pages: [1]   Go Down
 Author Topic: Correction Code -  (Read 448 times) 0 Members and 1 Guest are viewing this topic.
hellninjas
LV7 Elite (Next: 700)

Offline

Gender:
Last Login: 20 May, 2013, 23:07:31
Date Registered: 12 May, 2011, 02:15:30
Location: USA
Posts: 615

Topic starter
Total Post Ratings: +17

 « on: 09 May, 2012, 17:23:51 » 0

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
 12345678910111213141516171819202122 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: 09 May, 2012, 18:06:56 by hellninjas » Logged

Spoiler for Hidden:
Sorunome
Muffins
LV11 Super Veteran (Next: 3000)

Offline

Gender:
Date Registered: 26 September, 2011, 17:46:38
Location: Ponyville
Posts: 2925

Total Post Ratings: +161

 « Reply #1 on: 09 May, 2012, 17:51:51 » 0

Aren't there some ends missing at the end of the code? (two i think)
 Logged

http://z0r.de/4017
http://www.sorunome.de
http://reubenquest.net
+++++++[>++++++++++++<-]>.<+++[>----<-]>.---.<++++[>>++++++++<<-]>>.<++.------.++++++++++++.--------.

++++++[>++++++++++<-]>++++++++.<+++[>+++++++++++<-]>.+++++++++++++.--.<+++[>+++<-]>.<+++[>>++++++++++<<-]>>++.<<+++++++[>-------<-]>.<+++[>+++++++++++++<-]>..+++++++.<+++[>-----<-]>--.<++[>++++++<-]>++.

If OmnomIRC is screwed up, blame me

Spoiler for spoilers:

Spoiler for languages:
- TI-BASIC
- TI-Highbrid Basic
- Grammer
- Axe
- HTML
- JavaScript
- CSS
- PHP
- C++
- lua
- Python
- MYSQL
- Brainf*ck
- English
- German
Spoiler for internet:
/image/36691.png[/img]
Gimme internet NOW
Spoiler for me:
Spoiler for my little game:
my little game...my little game..aaaaaahhhhhh...my little game, i used to wonder how to lose the game, my little game, until you shared its losing with me. take the losing and the game, a beutiful game so losable, sharing losing is a easy sweat and losing makes it aweful neat to have my little game togeather with my very best games.
Spoiler for stuff:
Spoiler for derpy:

hellninjas
LV7 Elite (Next: 700)

Offline

Gender:
Last Login: 20 May, 2013, 23:07:31
Date Registered: 12 May, 2011, 02:15:30
Location: USA
Posts: 615

Topic starter
Total Post Ratings: +17

 « Reply #2 on: 09 May, 2012, 17:56:18 » 0

I have those in my code, I guess I forgot to type them
 Logged

Spoiler for Hidden:
Derf321
LV3 Member (Next: 100)

Offline

Last Login: 10 May, 2013, 18:34:42
Date Registered: 02 December, 2011, 05:55:26
Posts: 58

Total Post Ratings: 0

 « Reply #3 on: 11 May, 2012, 23:02:20 » 0

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.
 Logged
kindermoumoute

Offline

Last Login: 20 May, 2013, 23:02:59
Date Registered: 15 May, 2010, 17:53:56
Posts: 836

Total Post Ratings: +51

 « Reply #4 on: 12 May, 2012, 00:22:05 » 0

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.
 12345678 GetKey!If -1.getKey=1Else!If -1.getKey=2Else!If -1.getKey=3...
 Logged

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.
Coder Of Tomorrow
LV10 31337 u53r (Next: 2000)

Offline

Gender:
Date Registered: 30 May, 2010, 19:54:18
Location: eating somewhere
Posts: 1831

Total Post Ratings: +476

 « Reply #5 on: 15 May, 2012, 04:31:44 » 0

You should just be using getKey() instead of the BASIC-style getKey->var
 Logged

Read my webcomic! | My SoundCloud
Projects:

Check out the demo now!- Current progress: battle engine and stuff
Proud author of: Cuberunner | SpaceDash | The Psyche | XXEdit | AxeSynth | StickNinja | Gravity Guy | Embers:Phoenix | Zombie Gun
Axe: Need help optimizing?
User of Axe | zStart | TokenIDE | CalcGS | MirageOS
hellninjas
LV7 Elite (Next: 700)

Offline

Gender:
Last Login: 20 May, 2013, 23:07:31
Date Registered: 12 May, 2011, 02:15:30
Location: USA
Posts: 615

Topic starter
Total Post Ratings: +17

 « Reply #6 on: 15 May, 2012, 13:46:19 » 0

It's all in but I still can't get it to work ;.;
 Logged

Spoiler for Hidden:
 Pages: [1]   Go Up