Could you maybe tell a little more about what you need help with? Do need the sprites to move on their own in a specific direction? Click and drag? Player movement?
Last edited by pi3 (2012-05-09 19:54:50)
Offline
If you want click and drag, simply click on the lock button next to the name of the sprite at the top of the page. That will make it draggable for people viewing the project. If you need the player to move it, have a, when___key pressed, and then tell it what to do. Or you could get more complex and have a, when GF pressed, forever, if key___pressed, and again tell it what to do. if you need it to move on it's own, that's more complex, and I don't want to explain it until I know what you're planning on.
Offline
Draggable: click on the lock to the right of the name of the sprite.
Arrow key moving:
when key [up arrow/w v] pressed point in direction (0 v) move <speed> steps when key [down arrow/s v] pressed point in direction (180 v) move <speed> steps when key [left arrow/a v] pressed point in direction (-90 v) move <speed> steps when key [right arrow/d v] pressed point in direction (90 v) move <speed> steps
Last edited by PencilFactory (2012-05-10 20:59:21)
Offline
How about this?
when gf clicked set [draggable? v] to [false] forever if <(mouse down?) and (touching [mouse-pointer v] ? )> if <(draggable?) = [false]> set [draggable? v] to [true] repeat until <not (mouse down?)> go to [mouse-pointer v] end set [draggable? v] to [false] end
Last edited by jontmy00 (2012-05-11 06:28:02)
Offline
@jontmy00: that will make the sprite draggable if you hold down the mouse and run it over the sprite. It will also create a small "snapping" effect when it first goest into effect.
A more accurate script is this:
when [sprite 1] clicked set [x v] to ((mouse x)-(x position)) set [y v] to ((mouse y)-(y position)) repeat until <<(dragable?) = (true)> or <not <mouse down?>>> go to x: ((mouse x)-(x)) y: ((mouse y)-(y)) end
Last edited by MoreGamesNow (2012-05-11 07:16:02)
Offline
MoreGamesNow wrote:
@jontmy00: that will make the sprite draggable if you hold down the mouse and run it over the sprite. It will also create a small "snapping" effect when it first goest into effect.
A more accurate script is this:when [sprite 1] clicked set [x v] to ((mouse x)-(x position)) set [y v] to ((mouse y)-(y position)) repeat until <<(dragable?) = (true)> or <not <mouse down?>>> go to x: ((mouse x)-(x)) y: ((mouse y)-(y)) end
I admit. Your's better. I'll use it in my Pong game if needed.
Offline
maglet123 wrote:
thx every one i know how to do it now check out my new sonic sence creator
Now hit the "report" button below vv and request for it to be closed.
Offline