How I can make sprites drag with mouse, using code? I'm writing code for Battleships game, and I need codes for dragging with the mouse.
Think first what should happen in dragging,
now that we have already listed that, we can now think on the second step, translating it into a pseudo code.
if ( check here if the user is moving )
{
if ( check here if the user is holding left button )
{
if ( check here if mouse is inside the sprite )
{
set the position to the mouse pointer.
}
}
}
did you get that? :)