My sprite cannot sense when it is touching the color red, and it won't reset after it touches grey. Any idea why?
here
Offline
It looks to me like you're rendering the target AFTER checking to see if you're touching red (see below).
What you're doing:
forever clear check if touching red // impossible since you cleared the red target that was rendered last frame render red end
Offline
MoreGamesNow wrote:
It looks to me like you're rendering the target AFTER checking to see if you're touching red (see below).
What you're doing:Code:
forever clear check if touching red // impossible since you cleared the red target that was rendered last frame render red end
Why do I fail so much?
Offline
Also, can you figure out why the arrow won't reset? Or why the target keeps disappearing?
Offline
I "showed" the sprite continuously (instead of only when it should appear) and it never actually touches the gray line. It is also hidden when you do the sensing, which I believe means that it will always return false anyway.
Offline
mythbusteranimator wrote:
MoreGamesNow wrote:
It looks to me like you're rendering the target AFTER checking to see if you're touching red (see below).
What you're doing:Code:
forever clear check if touching red // impossible since you cleared the red target that was rendered last frame render red endWhy do I fail so much?
Seems like everytime i check you are asking something on help with scripts
Offline
MoreWillpower wrote:
mythbusteranimator wrote:
MoreGamesNow wrote:
It looks to me like you're rendering the target AFTER checking to see if you're touching red (see below).
What you're doing:Code:
forever clear check if touching red // impossible since you cleared the red target that was rendered last frame render red endWhy do I fail so much?
Seems like everytime i check you are asking something on help with scripts
It is because everything works out perfectly in my head, but it doesn't work when i PUT IT TO USE.
Offline
MoreGamesNow wrote:
I "showed" the sprite continuously (instead of only when it should appear) and it never actually touches the gray line. It is also hidden when you do the sensing, which I believe means that it will always return false anyway.
http://i47.tinypic.com/2vwbng8.png
if it is not sensing grey then you need to check your script, make sure it is set to sense the right colour as well
Offline
MoreGamesNow wrote:
I "showed" the sprite continuously (instead of only when it should appear) and it never actually touches the gray line. It is also hidden when you do the sensing, which I believe means that it will always return false anyway.
http://i47.tinypic.com/2vwbng8.png
Wait...is it going too fast, so it just skips right over the grey area?
Offline
mythbusteranimator wrote:
MoreGamesNow wrote:
I "showed" the sprite continuously (instead of only when it should appear) and it never actually touches the gray line. It is also hidden when you do the sensing, which I believe means that it will always return false anyway.
http://i47.tinypic.com/2vwbng8.pngWait...is it going too fast, so it just skips right over the grey area?
hmm
that is actually possible - set the arrow speed slower?
Offline
Or set it slower when it gets within a certain distance of the target, that way it won't affect the simulation/animation as much.
Offline
mythbusteranimator wrote:
MoreGamesNow wrote:
I "showed" the sprite continuously (instead of only when it should appear) and it never actually touches the gray line. It is also hidden when you do the sensing, which I believe means that it will always return false anyway.
http://i47.tinypic.com/2vwbng8.pngWait...is it going too fast, so it just skips right over the grey area?
I think the problem is more along these lines:
When you draw the arrow near the right side of the screen, the tip of your arrow ends up too far right, so that, when you sense to see if you're touching the line, your "bow" (the costume you're using to see if you're touching the gray line) is too far right.
Essentially: your bow can only go so far off the screen, and you're reaching that limit when you draw the arrow so that, when you move the bow back to its "sensing position", it isn't far enough right.
The above is just speculation, but I think it is much more likely that that is the problem than that you're "skipping" over the gray line (since you never actually end up past it anyway). That being said, "skipping" may become a problem once this one is resolved.
Offline
OK, I've downloaded your project and had a quick look at it.
Why is it all one script? I can understand why you might want to make a one-sprite game, but I'm not sure why you'd want just the one script. It'd be a lot easier (and would probably run faster if you broke the script up into chunks (and it would be ten times easier if you used more sprites!)
For your script:
1. You need to use 'colour X is touching colour Y?' instead of 'touching colour X?' because your sprite is permanently moving and redrawing, and is also mainly 'hidden'.
2. I think the reason it still doesn't sense if it's touching the colour is because the screen is 'refreshing' to often. Try moving it somewhere else. I tried putting it after the 'if shot = 1' block.
Although buggy, the arrow stopped if it touched the red target.
I couldn't get the 'if touching grey' block to work, so I suggest you replace that with a 'if arrowx > X1: set arrowx to X2". I haven't had a proper look at the code, but that might work.
Again, I haven't really looked to see if you can, but try and see if you can lighten the code a bit, it's very long and bloated.
Otherwise, it's a very ingenious project! Good luck
Edit: I've just noticed the title of the project '1s1s1c' - I'm guessing that means 1 sprite, 1 script, 1 c-something? In that case, I guess you won't be wanting to split the script into several parts. I still recommend you try and figure out some ways to lighten the script, if at all possible. Maybe trying using lists? Again, I don't know if that"ll work, I haven't looked properly at the entirety of the script.
Last edited by Llamalover (2012-11-10 17:06:07)
Offline
Llamalover wrote:
OK, I've downloaded your project and had a quick look at it.
Why is it all one script? I can understand why you might want to make a one-sprite game, but I'm not sure why you'd want just the one script. It'd be a lot easier (and would probably run faster if you broke the script up into chunks (and it would be ten times easier if you used more sprites!)
...
Edit: I've just noticed the title of the project '1s1s1c' - I'm guessing that means 1 sprite, 1 script, 1 c-something? In that case, I guess you won't be wanting to split the script into several parts. I still recommend you try and figure out some ways to lighten the script, if at all possible. Maybe trying using lists? Again, I don't know if that"ll work, I haven't looked properly at the entirety of the script.
I find the easiest ways to code 1s1s is to break the code into pieces and use something like this:
when gf clicked broadcast [initialize v] and wait forever broadcast [part1 v] and wait broadcast [part2 v] and wait broadcast [part3 v] and waitIt just makes it easier to organize and faster to edit the scripts.
Offline
Well, any luck? Have you got everything working?
Offline
MoreGamesNow wrote:
Llamalover wrote:
OK, I've downloaded your project and had a quick look at it.
Why is it all one script? I can understand why you might want to make a one-sprite game, but I'm not sure why you'd want just the one script. It'd be a lot easier (and would probably run faster if you broke the script up into chunks (and it would be ten times easier if you used more sprites!)
...
Edit: I've just noticed the title of the project '1s1s1c' - I'm guessing that means 1 sprite, 1 script, 1 c-something? In that case, I guess you won't be wanting to split the script into several parts. I still recommend you try and figure out some ways to lighten the script, if at all possible. Maybe trying using lists? Again, I don't know if that"ll work, I haven't looked properly at the entirety of the script.I find the easiest ways to code 1s1s is to break the code into pieces and use something like this:
when gf clicked broadcast [initialize v] and wait forever broadcast [part1 v] and wait broadcast [part2 v] and wait broadcast [part3 v] and waitIt just makes it easier to organize and faster to edit the scripts.
I haven't done the suggestions yet, because I have been busy.
But I will try them now.
(and I try to do 1s1s1c because they are more challenging and cooler. )
Offline
mythbusteranimator wrote:
MoreGamesNow wrote:
Llamalover wrote:
OK, I've downloaded your project and had a quick look at it.
Why is it all one script? I can understand why you might want to make a one-sprite game, but I'm not sure why you'd want just the one script. It'd be a lot easier (and would probably run faster if you broke the script up into chunks (and it would be ten times easier if you used more sprites!)
...
Edit: I've just noticed the title of the project '1s1s1c' - I'm guessing that means 1 sprite, 1 script, 1 c-something? In that case, I guess you won't be wanting to split the script into several parts. I still recommend you try and figure out some ways to lighten the script, if at all possible. Maybe trying using lists? Again, I don't know if that"ll work, I haven't looked properly at the entirety of the script.I find the easiest ways to code 1s1s is to break the code into pieces and use something like this:
when gf clicked broadcast [initialize v] and wait forever broadcast [part1 v] and wait broadcast [part2 v] and wait broadcast [part3 v] and waitIt just makes it easier to organize and faster to edit the scripts.I haven't done the suggestions yet, because I have been busy.
But I will try them now.
(and I try to do 1s1s1c because they are more challenging and cooler. )
Of course. I use the above script while my 1s1s projects are in development, and then just stick them all together at the end.
Offline