Windows How to recreate "Feeding Frenzy" Movement style.

T

Tsarem

Guest
Making a game similar to "Feeding Frenzy" in that, i wish to somehow use the mouse to move the sprite of the fish.

any tips?
 
F

Frozen Stick

Guest
Never played the game.Could you explain what exactly you are planning to do?
 
T

Tsarem

Guest
In the PC version of "Feeding Frenzy" players take control of a small fish as they eat smaller fish in order to move to the next fish, a little bigger. the player controls the fish('s) by pointing the mouse, with the fish following the mouse cursor.
 

Slyddar

Member
You can use point_direction to get the direction from the fish to the mouse, and then based on a speed variable, or if you player is clicking the the left mouse button, move the fish that direction, as well as align the image_angle so it points there too, if that's something you want. lengthdir_x and lengthdir_y can be used to find the x and y coordinates to move to. You would also want a nice slowdown due to the water, which you can get with lerp.

Something like this, as long as you created the x_move, y_move and fish_speed variables first in create.
Code:
//movement
if mouse_check_button(mb_left) {
    var _dir = point_direction(x, y, mouse_x, mouse_y);
    x_move = lengthdir_x(fish_speed, _dir);
    y_move = lengthdir_y(fish_speed, _dir);
    image_angle = _dir;
}

//slowdown
x_move = lerp(x_move, 0, .1);
y_move = lerp(y_move, 0, .1);

//apply movement
x += x_move;
y += y_move;
 
Last edited:
Top