Sign up
Login
New
Trending
Archive
English
English
Sign up
Login
New Paste
Add Image
/create /// ----------------- /// MOVEMENT VARIABLES /// ----------------- hsp = 0; vsp = 0; move_speed = 4; // Max horizontal speed accel = 0.5; // Horizontal acceleration friction = 0.3; // Friction when no input jump_speed = -10; // Jump speed grav = 0.5; // Gravity /// ----------------- /// DOUBLE JUMP / COYOTE TIME /// ----------------- can_double_jump = true; coyote_time_max = 6; // Frames you can still jump after leaving floor coyote_timer = 0; /// ----------------- /// PARTICLE SYSTEM psCloud = part_system_create(); partCloud = part_type_create(); // Use a circle shape instead of cloud part_type_shape(partCloud, pt_shape_circle); // Smaller size part_type_size(partCloud, 0.2, 0.4, 0, 0); // Speed & direction part_type_speed(partCloud, 1, 2, 0, 0); part_type_direction(partCloud, 0, 360, 0, 0); part_type_gravity(partCloud, 0, 0); // Life part_type_life(partCloud, 20, 30); // Opacity part_type_alpha2(partCloud, 1, 0); // ✅ Set color to white part_type_color1(partCloud, c_white); /// ----------------- /// RUNNING DUST PARTICLES /// ----------------- psDust = part_system_create(); partDust = part_type_create(); // Shape part_type_shape(partDust, pt_shape_circle); // Tiny size part_type_size(partDust, 0.1, 0.2, 0, 0); // Speed (slightly to the sides) part_type_speed(partDust, 0.5, 1, 0, 0); part_type_direction(partDust, 160, 200, 0, 0); // mostly down/behind player // Gravity (fall slightly) part_type_gravity(partDust, 0.1, 270); // Life part_type_life(partDust, 15, 25); // Fade out part_type_alpha2(partDust, 1, 0); // Color part_type_color1(partDust, c_white); //step /// ----------------- /// HORIZONTAL INPUT + SMOOTH ACCELERATION /// ----------------- var input = keyboard_check(ord("D")) - keyboard_check(ord("A")); if (input != 0) { hsp += input * accel; // accelerate if (hsp > move_speed) hsp = move_speed; if (hsp < -move_speed) hsp = -move_speed; } else { // Apply friction if (hsp > 0) { hsp -= friction; if (hsp < 0) hsp = 0; } else if (hsp < 0) { hsp += friction; if (hsp > 0) hsp = 0; } } /// ----------------- /// HORIZONTAL MOVE /// ----------------- x += hsp; if (place_meeting(x, y, oFloor)) { x -= hsp; hsp = 0; } // Spawn running dust if moving and on floor if (place_meeting(x, y + 1, oFloor) && hsp != 0) { // Start with center x var dust_x = x; // Offset dust behind player depending on movement direction if (hsp > 0) { dust_x = x - 4; // moving right → dust behind left } else if (hsp < 0) { dust_x = x + 4; // moving left → dust behind right } // Spawn dust at feet using bbox_bottom var dust_y = bbox_bottom; part_particles_create(psDust, dust_x, dust_y, partDust, 1); } /// ----------------- /// GRAVITY /// ----------------- vsp += grav; /// ----------------- /// COYOTE TIME & DOUBLE JUMP RESET /// ----------------- if (place_meeting(x, y + 1, oFloor)) { coyote_timer = coyote_time_max; can_double_jump = true; } else { coyote_timer -= 1; } /// ----------------- /// VERTICAL MOVE /// ----------------- y += vsp; if (place_meeting(x, y, oFloor)) { y -= vsp; vsp = 0; } /// ----------------- /// JUMP INPUT /// ----------------- if (keyboard_check_pressed(vk_space)) { if (coyote_timer > 0) { // Regular jump vsp = jump_speed; coyote_timer = 0; } else if (can_double_jump) { // Double jump vsp = jump_speed; can_double_jump = false; // On double jump part_particles_create(psCloud, x, y + sprite_height/2, partCloud, 10); } }
Settings
Title :
[Optional]
Paste Folder :
[Optional]
Select
Syntax :
[Optional]
Select
Markup
CSS
JavaScript
Bash
C
C#
C++
Java
JSON
Lua
Plaintext
C-like
ABAP
ActionScript
Ada
Apache Configuration
APL
AppleScript
Arduino
ARFF
AsciiDoc
6502 Assembly
ASP.NET (C#)
AutoHotKey
AutoIt
Basic
Batch
Bison
Brainfuck
Bro
CoffeeScript
Clojure
Crystal
Content-Security-Policy
CSS Extras
D
Dart
Diff
Django/Jinja2
Docker
Eiffel
Elixir
Elm
ERB
Erlang
F#
Flow
Fortran
GEDCOM
Gherkin
Git
GLSL
GameMaker Language
Go
GraphQL
Groovy
Haml
Handlebars
Haskell
Haxe
HTTP
HTTP Public-Key-Pins
HTTP Strict-Transport-Security
IchigoJam
Icon
Inform 7
INI
IO
J
Jolie
Julia
Keyman
Kotlin
LaTeX
Less
Liquid
Lisp
LiveScript
LOLCODE
Makefile
Markdown
Markup templating
MATLAB
MEL
Mizar
Monkey
N4JS
NASM
nginx
Nim
Nix
NSIS
Objective-C
OCaml
OpenCL
Oz
PARI/GP
Parser
Pascal
Perl
PHP
PHP Extras
PL/SQL
PowerShell
Processing
Prolog
.properties
Protocol Buffers
Pug
Puppet
Pure
Python
Q (kdb+ database)
Qore
R
React JSX
React TSX
Ren'py
Reason
reST (reStructuredText)
Rip
Roboconf
Ruby
Rust
SAS
Sass (Sass)
Sass (Scss)
Scala
Scheme
Smalltalk
Smarty
SQL
Soy (Closure Template)
Stylus
Swift
TAP
Tcl
Textile
Template Toolkit 2
Twig
TypeScript
VB.Net
Velocity
Verilog
VHDL
vim
Visual Basic
WebAssembly
Wiki markup
Xeora
Xojo (REALbasic)
XQuery
YAML
HTML
Expiration :
[Optional]
Never
Self Destroy
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Status :
[Optional]
Public
Unlisted
Private (members only)
Password :
[Optional]
Description:
[Optional]
Tags:
[Optional]
Encrypt Paste
(
?
)
Create Paste
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Site Languages
×
English