Thrown object in an arc

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Foxley
Metal Slime
Posts: 832
Joined: Sat Nov 09, 2013 5:54 pm

Thrown object in an arc

Post by Foxley »

I'd like to write a script to create a sprite slice at the hero's X/Y position and throw it in an arc - which would mostly be noticeable when throw to the left or right.

I'm guessing that slice velocity would be used, but I can't think of a way to make that look good when thrown up or down, since it'd be a totally different look. On that note I just now realized that there's no slice z dimension.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

There's a number of ways to go about it, but slice velocity commands aren't a complete solution. See the 'Hero/NPC/object graphics/animations' section of the Script Dump, it links to a lot of arcing scripts. To emulate slice z coordinates, you could set the x/y position on a container slice, and the z position (as negative y coordinate) on a child of it. But I would only bother to do that if the x/y position of the slice on the ground is important for collision detection (or for a shadow), otherwise you can just subtract z from the y position to get the effective y.
Post Reply