Grappling Hook: Platform Game Engine

Grappling Hook: Platform Game Engine

by TheGreenFlash

👁 47,830 ❤️ 1,459 ⭐ 1,304 🔄 103
Created: Nov 17, 2018 Last modified: Jul 3, 2020 Shared: Nov 19, 2018

Description

Welcome to TheGreenFlash's Grappling Hook Platform Game Engine! Instructions general movement – arrow keys or wasd aim hook – mouse pointers throw/retract hook – mouse click or space bar Here's an example of this engine used in a real game by @QuentinTheOof https://scratch.mit.edu/projects/391270472/ Also, check out this new game! https://scratch.mit.edu/projects/325057024/ About the Code This sprite contains the single script for all the movements of the player with a grappling hook. All other sprites are unnecessary. The hook and the rope are both stamped with pen. Currently (this can be changed) the player interacts with anything that is colored black. While the physics are not perfect, they are accurate enough for the intended purposes (i.e. if you are attempting to mathematically determine your ability to leap across an abyss of specified width with the device depicted herein, I would not recommend it, but if you're making a cool game, go for it). How do I put this in my game? One of the main objectives in mind when coding this engine was making it easy for an average Scratcher to use. The script is similar to many platform scripts in that it is in a forever loop. This makes it easy to build a project around it. All you need for the grappling hook to work is the main script in this sprite. Then add whatever you want to make the game your own! Troubleshooting/Things to note when remixing this 1) The grappling hook costume must be called "Grappling Hook" and the player's costume must be called "Player" unless you update the two [switch costume to [ ]] blocks near the end of the script. 2) The collision detection is coded to detect the color black. This can be changed by swapping out the nine <touching color [ ]> blocks for whatever you want it to detect. 3) When the green flag is clicked, the sprite will start at the coordinates in the third block of the script. 4) The variables Speed, Jump Height, and Hook Throw Distance control these three aspects of the player's movement. They are currently set to be realistic for the size of the sprite, but may be changed for the remixer's needs. Variable Overview: • Counter – an unnecessary variable to tell me how long I've been working on the project • HStage – Hook Stage – tells whether the hook is unused (0), being thrown (1), in use (2), or being retracted • Hdis – Hook Distance – tells the current length of the rope • Hook Just Activated – binary variable for making sure the space bar is not pressed at some point between throws • Hook Throw Distance – preset variable to control how hard the hook is thrown • Hx – Hook x position – tells the x position of the hook • Hxvel – Hook x velocity – the the velocity of the hook along the x axis • Hy – Hook y position – tells the y position of the hook • Hyvel – Hook y velocity – the the velocity of the hook along the y axis • Jump Height – preset variable to control how high the player can jump • Px – Player x position – remembers the x position of the player when the hook is being stamped • Py – Player y position – remembers the y position of the player when the hook is being stamped • Speed – preset variable to control how fast the player can move • xvel – x velocity – tells the player's velocity along the x axis • yvel – y velocity – tells the player's velocity along the y axis Questions? Need help? Feel free to ask in the comments! @TheGreenFlash Curated by @Esfeon 6/14/20 Update Log 11/19/18 - project shared 11/20/18 - mouse clicking added in addition to space bar to toggle grappling hook 6/8/20 - added custom reset player and hook to point block 6/15/20 - grappling hook is now set to unused state if touching the bottom edge and vertical velocity is less than zero

Project Details

Visibility
Visible
Comments
Enabled

More Cool Projects

Project thumbnail
View Project

Geometry Dash DECODE WAVE

by HANK10272018

Project thumbnail
View Project

Taxi Simulator BETA

by tigertut

Project thumbnail
View Project

ハナタバ - 文字pv&スクリプト演奏 [pv大会参加作品]   #Laiboo

by laiboo

Project thumbnail
View Project

[レート対戦]大乱闘スマッシュブラザーズ8++ -[ スマプラ ]-  (スマブラ)(ハイクオリティー)(楽しい)(なんでも)(プラットフォーマー)(超進化)(最新)(ドット絵アート)(ゲーム)

by Nite-games

Project thumbnail
View Project

すごろくRPG

by kazu_papa

Project thumbnail
View Project

Among Us | Online | Server 2 #Games #Mobile

by KickBackAndRelax

Project thumbnail
View Project

自作ハックブロック集

by Es-2

Project thumbnail
View Project

Raycaster with heights

by Howl144

Project thumbnail
View Project

Egg Clicker

by igoicoecir

Project thumbnail
View Project

Numberblocks Band halves 6

by KhooLengChoo

Project thumbnail
View Project

3D Sphere Editor

by Scratch-Minion

Project thumbnail
View Project

Griffpatch Says (2287 words!!) | A griffpatch speech engine (+ ID 710002040)

by MonkeyBean2

Project thumbnail
View Project

Mini-Python - Run python 3 commands in scratch

by minetester

Project thumbnail
View Project

☁Rhythm Game - Square Battle v2.4.1.5

by SuperEndless

Project thumbnail
View Project

Ink sans fight (my version).

by bruhba

Project thumbnail
View Project

Numberblocks Emergency Number [REMADE]

by BlueTheNumberblock

Project thumbnail
View Project

Rebound Rally

by RakeEMonday

Project thumbnail
View Project

FNFBIC [songs unfinished]

by TheSwedishDuck

Project thumbnail
View Project

TR!Last Bad Time Trio Phase 1 Fight Remastered

by Ink_Sans58

Project thumbnail
View Project

I wanna be the color needle

by taigaW

Project thumbnail
View Project

Fnf Bob Mod Remastered I guess.

by --ShadowAnimations--

Project thumbnail
View Project

Ep. 1: Nano False Reports Projects/Grounded

by guyinoblivion

Project thumbnail
View Project

henry stickmin(infiltrating the airship 2) 1.0

by asdeo1

Project thumbnail
View Project

Crystal Seeker Extra-Land #Games DESC

by Kuzyn_Official