Point-and-Click Pirate Adventure
A downloadable game for Windows
Guide your rat pirate (pirate? bilgerat?) through some islands to collect scrap and a rare power cell that can be used to repair the crew's damaged ship.
All assets and code were created by myself within the space of a single week.
Controls:
- LMB to move
- RMB to interact
Be aware this file is pretty large, as it's the first ttime I experimented with sound in GameMaker Studio 2, so there's a hefty track of background music in there.
Most of the code for this game was borrowed from an earlier point-and-click movement system I had attempted. The earlier version, however, suffered greatly from scope bloat and was highly unstable -- this system represents a more refined version of that mechanic.
Relevant move target code:
if (!obj_gui.paused && mouse_check_button(mb_left)) { x = mouse_x; y = mouse_y; image_alpha = 1; image_xscale = 1.5; image_yscale = 1.5; } else { image_alpha = 1; image_xscale = 1; image_yscale = 1; } if (obj_player.hspeed == 0 && obj_player.vspeed == 0) { image_alpha = 0; }
This code is obviously pretty simple, as it just sets the target to the location of the mouse if LMB is down and turns invisible if the player has stopped, either by reaching its destination or hitting a wall.
Relevant player code:
if (obj_target.x > x) { image_xscale = 1; } else if (obj_target.x < x) { image_xscale = -1 } if (distance_to_point(obj_target.x, obj_target.y) > runDist) { move_towards_point(obj_target.x, obj_target.y, runSpd); currentSpd = runSpd; } else if (distance_to_point(obj_target.x, obj_target.y) > walkDist) { move_towards_point(obj_target.x, obj_target.y, walkSpd); currentSpd = walkSpd; } else if (distance_to_point(obj_target.x, obj_target.y) >= slowDist) { move_towards_point(obj_target.x, obj_target.y, slowSpd); currentSpd = slowSpd; } else { speed = 0; currentSpd = 0; } if (place_meeting(x + hspeed, y + vspeed, obj_collision) || place_meeting(x + hspeed, y + vspeed, obj_collision_small)) { speed = 0; obj_target.x = x; obj_target.y = y; }
This is a lot of code that simply allows the player to move at multiple speeds depending on how far away the move target is.
Ultimately, the code for this prototype wasn't much new to me -- most of the work was put into level design instead. This game was a practice in measured and purposeful level design and I hope that shows in the final product.
Download
Install instructions
Run the executable to play.
Leave a comment
Log in with itch.io to leave a comment.