Very nice, I agree with CDI on that.
CDI wrote:
Just a helpful hint, if you store your pickups in a list, you can have conditionals based on one time pickups. Say the gun, you can have part of the matrix be "4L1(1)" as opposed to just "4" and make L1(1) be 0 when you pick up the gun, so you can only get it once. Just a thought.
I forgot all about being able to do that in matrices, thanks for the reminder.
comicIDIOT wrote:
KermMartian wrote:
Stop double-posting. If you can't edit your posts, delete your old post before you post a new post.
I am too lazy to actually make my own post so instead I quote people and then don't say anything newdragon1414@att.net / Google and Yahoo E-Mail
Bump
I have thought on this some, and I am curious on an experts opinion. Would having movement be the main loop, possibly enemy movement (if I add some) all that is in the main loop, and have all the extras, such as the events, attacks, etc.. outside of it so that it doesn't go through all the conditionals. My only problem about just doing that is needing a Goto, I think, unless 2 while loops inside of one, like this:
Code:
Would that work?
I have thought on this some, and I am curious on an experts opinion. Would having movement be the main loop, possibly enemy movement (if I add some) all that is in the main loop, and have all the extras, such as the events, attacks, etc.. outside of it so that it doesn't go through all the conditionals. My only problem about just doing that is needing a Goto, I think, unless 2 while loops inside of one, like this:
Code:
:While W=1
:2->W
:While W=2
:"Main movement loop"
:If a list of buttons are pressed, store 3 to W
:End
:While W=3
:"Rest of code"
:End
:End
Would that work?
comicIDIOT wrote:
KermMartian wrote:
Stop double-posting. If you can't edit your posts, delete your old post before you post a new post.
I am too lazy to actually make my own post so instead I quote people and then don't say anything newdragon1414@att.net / Google and Yahoo E-Mail
What's wrong with:
Code:
Code:
While some condition
random code
key-independent stuff
getKey->K
if not(K:End
key-dependent stuff
End
KermMartian wrote:
What's wrong with:
Code:
Code:
While some condition
random code
key-independent stuff
getKey->K
if not(K:End
key-dependent stuff
End
The fact there are going to be quite a few weapons in all, I am hoping for about 6 at the most, if all goes well, and those are all key-dependent, along with the movement, just having 2 weapons slows it down quite a bit.
comicIDIOT wrote:
KermMartian wrote:
Stop double-posting. If you can't edit your posts, delete your old post before you post a new post.
I am too lazy to actually make my own post so instead I quote people and then don't say anything newdragon1414@att.net / Google and Yahoo E-Mail
KermMartian wrote:
So you're saying not much of it could go in the key-independent section?
The only things that will be key-independent is the map rendering and determining what weapons and items you have.
comicIDIOT wrote:
KermMartian wrote:
Stop double-posting. If you can't edit your posts, delete your old post before you post a new post.
I am too lazy to actually make my own post so instead I quote people and then don't say anything newdragon1414@att.net / Google and Yahoo E-Mail
Sonlen wrote:
KermMartian wrote:
So you're saying not much of it could go in the key-independent section?
The only things that will be key-independent is the map rendering and determining what weapons and items you have.
KermMartian wrote:
Sonlen wrote:
KermMartian wrote:
So you're saying not much of it could go in the key-independent section?
The only things that will be key-independent is the map rendering and determining what weapons and items you have.
What I decided to try and do is separate the attacking and movement into 2 loops, one is activated if a certain button is pressed. The issue is I need at least 1 weapon usable while jumping, probably the sword right now as it is the smallest in number of commands and conditionals right now.
Is there a way to check if you X,Y coordinates are within 2 and 7 for X for 2 and 15 for Y with one condition, so it is like X>1 and X<15 but with lets say a max() in the conditional?
I guess I could add a bit more to this also, what if I the want to see if the location on the matrix in a certain direction is a 0, >6, <10, or 12 without using a massive number of conditions in one If statement?
comicIDIOT wrote:
KermMartian wrote:
Stop double-posting. If you can't edit your posts, delete your old post before you post a new post.
I am too lazy to actually make my own post so instead I quote people and then don't say anything newdragon1414@att.net / Google and Yahoo E-Mail
Regarding part 1:
Code:
Which is the same as
Code:
I use this code to generate that (It revolves around a math concept I could never remember):
Code:
Which will give you the statement for a one part conditional: A<High And A>Low. Hope that helps.
For the second part, you'd have to ask a certain Weregoose to shorten that, I would just do the individual parts, because it will be faster than doing insane math.
Code:
If abs(X-4.5)<=2.5
Code:
If X>=2 And X<=7
Code:
Input "HIGH:",A
Input "LOW:",B
abs(A+B)/2
Text(0,0,"Abs(A-",Ans,")<",Max(A,B)-Ans
For the second part, you'd have to ask a certain Weregoose to shorten that, I would just do the individual parts, because it will be faster than doing insane math.
Sonlen wrote:
Is there a way to check if you X,Y coordinates are within 2 and 7 for X for 2 and 15 for Y with one condition, so it is like X>1 and X<15 but with lets say a max() in the conditional?
I guess I could add a bit more to this also, what if I the want to see if the location on the matrix in a certain direction is a 0, >6, <10, or 12 without using a massive number of conditions in one If statement?
I guess I could add a bit more to this also, what if I the want to see if the location on the matrix in a certain direction is a 0, >6, <10, or 12 without using a massive number of conditions in one If statement?
You're going to have to elaborate more on that, plus I think you made some errors that make it unworkable.
Simplifying _player1537's part-one gives 6>abs(2X-9, which is the same size as the original, but I'm not sure that it's faster.
And another rendition of his generating code would be: .5abs({A-B,A+B
Weregoose wrote:
Sonlen wrote:
Is there a way to check if you X,Y coordinates are within 2 and 7 for X for 2 and 15 for Y with one condition, so it is like X>1 and X<15 but with lets say a max() in the conditional?
I guess I could add a bit more to this also, what if I the want to see if the location on the matrix in a certain direction is a 0, >6, <10, or 12 without using a massive number of conditions in one If statement?
I guess I could add a bit more to this also, what if I the want to see if the location on the matrix in a certain direction is a 0, >6, <10, or 12 without using a massive number of conditions in one If statement?
You're going to have to elaborate more on that, plus I think you made some errors that make it unworkable.
A couple questions on that:
1. How would it be unworkable?
2. How could I elaborate even more? If the coordinate you are looking at is a 0, between 6 and 10 (>6 and <10), or a 12, then the condition will be true.
Does that bit help?
comicIDIOT wrote:
KermMartian wrote:
Stop double-posting. If you can't edit your posts, delete your old post before you post a new post.
I am too lazy to actually make my own post so instead I quote people and then don't say anything newdragon1414@att.net / Google and Yahoo E-Mail
The implicit OR between ">6, <10" from your last post did it in.
What is the possible range for the coordinate?
What is the possible range for the coordinate?
Weregoose wrote:
The implicit OR between ">6, <10" from your last post did it in.
What is the possible range for the coordinate?
What is the possible range for the coordinate?
I am using a matrix for a map(whats new :p). So it is 8x16, and the possible numbers in it I am planning on having 0-20 hopefully tops, I shouldn't need to add anymore then that.
comicIDIOT wrote:
KermMartian wrote:
Stop double-posting. If you can't edit your posts, delete your old post before you post a new post.
I am too lazy to actually make my own post so instead I quote people and then don't say anything newdragon1414@att.net / Google and Yahoo E-Mail
Weregoose wrote:
not(fPart(838383/(10X-83
Just go with it.
Just go with it.
I am going with it, but it really is a big number and an not(fPart()) :p
comicIDIOT wrote:
KermMartian wrote:
Stop double-posting. If you can't edit your posts, delete your old post before you post a new post.
I am too lazy to actually make my own post so instead I quote people and then don't say anything newdragon1414@att.net / Google and Yahoo E-Mail
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
» Go to Registration page
» Goto page Previous 1, 2
» View previous topic :: View next topic
» View previous topic :: View next topic
Page 2 of 2
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Advertisement