In ONE SCRIPT, please show me how to do this.
I want to be able to move my ball after it switches to the costume, but the "point in direction" and then "move 2 steps" script isn't working. Is there some trig you do to change x and y by using the direction? I need help.
Offline
See? I get the trig right for one bounce in this project, but then it starts to keep tailing to the right. What is wrong?
Offline
I personally find it easier to deal with x and y velocities (and ignore direction) if you're dealing with only walls either parallel or perpendicular to the x axis (like you are).
when gf clicked forever draw paddle go to [whereever the ball is supposed to be v] change x by (xvel) change y by (yvel) if<touching color [color of bass]?> set [yvel v] to ((-1)*(yvel)) change y by (yvel) end if<([abs v] of (x position)) > [240]> set [xvel v] to ((-1)*(xvel)) change x by (xvel) end check for goals, etc.
Offline
Just curious, but when a sprite flashes in test mode (while moving) but hides in presentation mode, what will it do after being uploaded?
Offline
I'm probably the wrong guy to talk to about stuff like this, but the key to rendering multiple things with one sprite is the slight built-in delay between the end of the loop and the beginning. This means that you'll probably end up seeing whatever is rendered at the end of the loop. It also means that when you clear it, you need to make sure the "clear" block is above the rendering script (so the slight delay occurs after rendering, not after "clearing")
Offline
MoreGamesNow wrote:
I'm probably the wrong guy to talk to about stuff like this, but the key to rendering multiple things with one sprite is the slight built-in delay between the end of the loop and the beginning. This means that you'll probably end up seeing whatever is rendered at the end of the loop. It also means that when you clear it, you need to make sure the "clear" block is above the rendering script (so the slight delay occurs after rendering, not after "clearing")
The "clear" block is at the top of the script, if that is what you mean.
Offline
mythbusteranimator wrote:
MoreGamesNow wrote:
I'm probably the wrong guy to talk to about stuff like this, but the key to rendering multiple things with one sprite is the slight built-in delay between the end of the loop and the beginning. This means that you'll probably end up seeing whatever is rendered at the end of the loop. It also means that when you clear it, you need to make sure the "clear" block is above the rendering script (so the slight delay occurs after rendering, not after "clearing")
The "clear" block is at the top of the script, if that is what you mean.
Offline
I'm looking at your script, and I'm a little confused. Could you tell me exactly what you're trying to accomplish, and why you're using a list when it appears you are only using the first item?
Offline
MoreGamesNow wrote:
I'm looking at your script, and I'm a little confused. Could you tell me exactly what you're trying to accomplish, and why you're using a list when it appears you are only using the first item?
Right now, the list thing should not be a problem; it is only keeping the length of the score for later in the script (and it works). I want to figure out to show the ball, as it hides in presentation mode/uploaded, but it flashes in test mode.
Offline
Put a "stamp" before you "hide" your ball. I think I got it working but I can't seem to upload a picture and it is way too long for me to type up
BTW, you can just do this for collisions. If you move only along the x axis, you can be sure that you're hitting either the left or right side (resulting in a reversal of x velocity). Likewise, if you move only along the y axis (or, in this case, after you've moved along the x axis), you can be sure that you're hitting one of the horizontal objects.
change x by (xvel) if<touching [edge v]?> set [xvel v] to ((-1)*(xvel)) change x by (xvel) end change y by (yvel) if<<touching [edge v]?> or <touching color [color of paddle]?>> set [yvel v] to ((-1)*(yvel)) if<touching color [color of paddle]?> add point; make more difficult, etc. else if<(y position) < [0]> lose a life, if >5 stop all, etc. end end change y by (yvel) end
Last edited by MoreGamesNow (2012-11-04 21:34:41)
Offline
Thanks a TON! I got it working now; I'll be sure to give a lot of credit!
Offline