Hello Everybody,
I'm currently working on a scrolling platformer. I'm working on a base for it, and I have a huge problem with it. The engine has a large color fractal script that has one part managing the xvel variable. It looks like this:
when gf clicked repeat until <(won) = [1]> ... if <not<touching color [grey]>> ... if <key [right arrow v] pressed> change [xvel2 v] by 0.05 end end endThis did not work. The variable xvel2 was not changing at all.
when gf clicked forever say <join <touching color [grey]> <key [right arrow v] clicked>> endThe phrase when I pressed the right arrow was always "falsetrue" Therefore, the booleans should have been working right.
Last edited by Programmer_112 (2013-03-09 22:05:34)
Offline
I looked through your script, and ignoring the blanked-out parts, it should be working, so I'm predicting that something's going wrong in the parts of your script that you didn't show. So, could you show them?
With regards,
ErnieParke
Offline
OK, I'll head what I have so far as soon as I can.
EDIT: Here is what I have so far. My broken project.
Last edited by Programmer_112 (2013-03-10 15:24:31)
Offline
Programmer_112 wrote:
OK, I'll head what I have so far as soon as I can.
EDIT: Here is what I have so far. My broken project.
Okay, I'll be looking at it sometime soon.
With regards,
ErnieParke
Offline
ErnieParke wrote:
Programmer_112 wrote:
OK, I'll head what I have so far as soon as I can.
EDIT: Here is what I have so far. My broken project.Okay, I'll be looking at it sometime soon.
With regards,
ErnieParke
Thanks!
Offline
Firedrake969 wrote:
What does the variable "won" display?
Should be 1, but I might have glitched it. Sadly, my dad just banned me from the computer for the rest of today for some reason. I'll check as soon as possible.
Last edited by Programmer_112 (2013-03-10 20:40:26)
Offline
Firedrake969 wrote:
What does the variable "won" display?
"won" is reporting 0.
Last edited by Programmer_112 (2013-03-11 21:28:47)
Offline
Programmer_112 wrote:
Does anyone have any idea what the problem is?
Sorry for not responding earlier, though yes, I do know what the problem is, and it's not with the script that you showed us above. So let's look at this script instead:
when gf clicked forever change y by (yvel2) if <(x position) < (0)> Run scripts... else change x by (xvel2) end
Last edited by ErnieParke (2013-03-16 12:46:38)
Offline
I don't know how you want this little creature to behave, but currently you have a script
that forever sets xvel2 to 0.92 * xvel
There's nothing changing the value of xvel, causing xvel2 to stay at 0 forever..
Offline
ErnieParke wrote:
Programmer_112 wrote:
Does anyone have any idea what the problem is?
Sorry for not responding earlier, though yes, I do know what the problem is, and it's not with the script that you showed us above. So let's look at this script instead:
when gf clicked forever change y by (yvel2) if <(x position) < (0)> Run scripts... else change x by (xvel2) end
Well the problem this is causing is that your person is always below 0, and so it's x position never gets changed. Once you fix that, you should be good. ;)
I hope that this helps!
With regards,
ErnieParke
Oh. Thanks!
Offline
Programmer_112 wrote:
ErnieParke wrote:
Programmer_112 wrote:
Does anyone have any idea what the problem is?
Sorry for not responding earlier, though yes, I do know what the problem is, and it's not with the script that you showed us above. So let's look at this script instead:
when gf clicked forever change y by (yvel2) if <(x position) < (0)> Run scripts... else change x by (xvel2) end
Well the problem this is causing is that your person is always below 0, and so it's x position never gets changed. Once you fix that, you should be good. ;)
I hope that this helps!
With regards,
ErnieParkeOh. Thanks!
Well it's nothing.
With regards,
ErnieParke
Offline