JustPaste
HomeCategoriesAboutDonateContactTerms of UsePrivacy Policy
JustPaste

Free online notepad — write and share instantly

Navigate

  • Home
  • Timeline
  • Categories

Info

  • About
  • Donate
  • Contact

Legal

  • Terms of Use
  • Privacy Policy

© 2026 JustPaste.app. All rights reserved.

Made with ♥ by JustPaste

اسکریپت | JustPaste.app
29 days ago6 views
👨‍💻Programming

اسکریپت

extends KinematicBody2D

var velocity = Vector2()
var speed = 250
var gravity = 1200
var jump_speed = -500

func _physics_process(delta):
    velocity.x = 0

    if Input.is_action_pressed("ui_right"):
        velocity.x = speed
    elif Input.is_action_pressed("ui_left"):
        velocity.x = -speed

    velocity.y += gravity * delta

    if is_on_floor() and Input.is_action_just_pressed("ui_accept"):
        velocity.y = jump_speed

    velocity = move_and_slide(velocity, Vector2(0, -1))

⚠️Content was pasted as plain text and auto-formatted as a code block. Use the Code Block button in the editor for proper formatting.

← Back to timeline