The Dink Network

Reply to Waypoints

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
May 16th 2006, 09:35 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
A couple days ago, I decided to start working on my D-Mods again. Shock, awe.

I wanted a sprite to move in a really bizarre manner, flying across multiple screens in loops and curves.

The only way to make a sprite move in loops and curves is to use sp_mx and sp_my (and 1.08's sp_move_x and sp_move_y) or to hard-code sp_x and sp_y coordinates in order. Either of these methods would be hours upon hours of trial-and-error to calculate.

So I had an idea: Waypoints. Essentially, I place several sprites on the screen, which aren't visible during the game. Then I have my moving sprite target each of those sprites and move to each one in order.

Right now it works, but the speed varies quite wildly between each 'jump', so I have to normalize the speed so it is about the same value.

There's a good chance I'll release some sort of video tutorial (with sample scripts) for people to use. With some modifications (i.e. the use of move_stop instead of sp_mx/sp_my) it could even be useful for things like guards. That way you could have a guard follow a set path without coding it, and then you can just move the waypoints if you decide to change the map later.