Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
22 May, 2013, 00:45:30 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-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
  Print  
Author Topic: Correction Code -  (Read 448 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
hellninjas
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
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

View Profile
« 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 Cheesy

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
0->G
repeat getkey(15)
DispgraphClrdraw
For(G,1,I)               //Repeat code for every bullet
Pxl-Off{L1+(G*4)},{L1+(G*4)+1})      //Turn display for bullet off

If {L1+(G*4)+2}=1:{L1+(G*4)+1}-1->{L1+(G*4)+1}               //Depending on what direction bullet has, move it that way
End
If {L1+(G*4)+2}=2:{L1+(G*4)}+1->{L1+(G*4)}
End
If {L1+(G*4)+2}=3:{L1+(G*4)+1}+1->{L‚+(G*4)+1}
End
If {L1+(G*4)+2}=4:{L1+(G*4)}-1->{L1+(G*4)}
End:End

For(G,1,I)                                                   //Repeat code for every bullet
If 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}
Else
Pxl-On({L1+(G*4)},{L1+(G*4)+1})              //Otherwise, turn the bullet back on
End

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 Offline

Gender: Male
Last Login: Yesterday at 01:55:56
Date Registered: 26 September, 2011, 17:46:38
Location: Ponyville
Posts: 2925


Total Post Ratings: +161

View Profile WWW
« 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.youtube.com/watch?v=BFOoazEx9lU
http://www.sorunome.de
http://reubenquest.net
+++++++[>++++++++++++<-]>.<+++[>----<-]>.---.<++++[>>++++++++<<-]>>.<++.------.++++++++++++.--------.

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

If OmnomIRC is screwed up, blame me Tongue

Save Derpy!(http://www.youtube.com/watch?v=cg-_HeVNYOk)
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 Offline

Gender: Male
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

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

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

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

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

Total Post Ratings: 0

View Profile
« 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
LV8 Addict (Next: 1000)
********
Offline Offline

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


Total Post Ratings: +51

View Profile
« 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.
Optimize it please x) :

1
2
3
4
5
6
7
8
GetKey
!If -1
.getKey=1
Else!If -1
.getKey=2
Else!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 Offline

Gender: Male
Last Login: Yesterday at 18:24:17
Date Registered: 30 May, 2010, 19:54:18
Location: eating somewhere
Posts: 1831


Total Post Ratings: +476

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

You should just be using getKey() instead of the BASIC-style getKey->var Tongue
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 Offline

Gender: Male
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

View Profile
« 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
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.241 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.