Hi, I'm guessing this has come up before but I can't seem to find any way around the problem I'm having.
I would like a type of variable that is a list. So I can add numbers to the List.
Maybe have Blocks in the Variable section like:
Add Number [x]/ Remove Number [x]
and boolean
contains number[x]
I want this becasue im trying to make a card game and the only way I can think to remember what cards have left the deck is to put them in a list.
Well that or something like:
Variable * 100 + [2 digit card number] to store
and some dividing and rounding trickery to check.
Another thing I like is the abbility to write custom blocks that you can get numbers from.
I tried to make pythagorous theorum for the distance between 2 objects and ended up with a mile long block that was hard to manage, so I'd like to be able to break this up in to smaller parts, like make a block that you could put 2 numbers in to and it gave you a custom result.
Offline
Well, for the lists problem, it has had SO much attention, I think they're adding it. Of course, if it's like Jens, it would have the contains or something like it. And boolean already Kind OF exists, with the if blocks and Key Pressed blocks. As for the numbers, I don't really get it, but it doesn;t seem like something they wuld implement. but I dunno, cause I don't really understand it
Offline
Yes Sorry what I meant about boolean, was that the: contains [x] would be somethig to fit in to an if. As for the numbers thing what I mean is like this (( <+> )) gives you a + block, id like to create a custom ones.
My idea is that you could make a function just like youd make a sprite like this below:
A function wouldn't have a number of inputs (like variables) and one variable called output, that you have to set at the end of the script, functions would have no costumes or sounds just sripts like this one here that has just 1 input, this function is for squaring a number (ie a number times by itself)
When you make a Function you also get allong with it a new block in the section like this:
and the block has the same nuber of inputs as the Function, from the code this is what would happen if you used the square block:
And here's anothe possible one, this one has 2 inputs and works out the size of the difference between 2 numbers (ie there's no minuses involved):
With this Function of course you also get this block:
What you could also do is make a function that uses other functions that you've already made like this one for calculating pytagorases theorum for calculating the length hypotinuse of a right angled triangle from the length of the other 2 sides.
So the inputs here are the lengths of the two other sides of the triangle:
and making this function creates this block:
Then you could use your newy created number blocks to make your scripts in other things look more simple, like this script that gives you the distance between 2 objects:
click this image to see it full sized.
I hope this explination of my idea clarifies things, if not I will try and answer questions about it.
Last edited by TOCM (2008-07-19 09:17:14)
Offline
I know my example of distance between is already possible, but I waned to try and make it easier to understand, Also there a sort of example oh how I try and deal with this already, in "my stuff" but the problem with it is that you dont get the Block, so you cant do multiple operations without storing the results first.
Last edited by TOCM (2008-07-19 10:03:33)
Offline
*, sorry for this, I've jus noticed that my bright idea is already being discussed in full in another thread, don't know if I've bought anything new to the field but still at least i know it is a good idea.
Offline