Search
 
SCRIPT & CODE EXAMPLE
 

HTML

tutorial

<!-- tutorial for all languages -->
https://devtut.github.io/
Comment

tutorial


var motion = Vector2()
var speed  = 150
var gravity = 30
var jump=-600
var double_jump_power = -750
var can_double_jump = false
func _ready():
	
	pass
func _physics_process(delta):
	Double_jump_and_jump()
	if Input.is_action_pressed("ui_right"):
		motion.x = speed 
		A.play("run")
		A.flip_h = false
	elif Input.is_action_pressed("ui_left"):
		motion.x = -speed
		A.play("run")
		A.flip_h = true
	else:
		motion.x = 0
	if is_on_floor()==false:
		motion.y +=  gravity
	move_and_slide(motion,Floor)
func Double_jump_and_jump():
	if is_on_floor()==true:
		can_double_jump=true
	if Input.is_action_just_pressed("ui_up")&& is_on_floor()==true:
		motion.y = jump
	#double_jump if you dont like it just remove these lines of code downhere 
	if is_on_floor() ==false && motion.y > 0 && can_double_jump==true&& Input.is_action_just_pressed("ui_up"):
		motion.y = double_jump_power
		can_double_jump=false
	pass
#plz if this helped you donate
#or check out my NFT discord server if you want to help me https://discord.gg/YK6BqdbT
Comment

PREVIOUS NEXT
Code Example
Html :: heiht jtml 
Html :: el cerdo 
Html :: drag and drop to css 
Html :: html textarea placeholder multiple lines 
Html :: physical and logical tags in html 
Html :: minimum html document vs code shortcut 
Html :: meta initial scale resize to fit screen 
Html :: eleventy loop over global data 
Html :: rainbow hr html 
Html :: python split html header 
Html :: music from stick with it 
Html :: react hooks html onchange two functions 
Html :: ubuntu 19.10 vmware 
Html :: centralize email body 
Html :: how to hide youtube watermark from embedded video :2021 
Html :: Uncaught TypeError: CanvasRenderingContext2D.drawImage: Argument 1 could not be converted to any of: HTMLImageElement, SVGImageElement, HTMLCanvasElement, HTMLVideoElement, OffscreenCanvas, ImageBitmap 
Html :: html interview questions 
Html :: how to add map in html 
Html :: html multi page website 
Html :: print tag in html 
Html :: Full Form Of RAR 
Css :: reset a tag css 
Css :: css underline color 
Css :: last second css 
Css :: hide number trigger in html page 
Css :: css center image 
Css :: remove ul decoration 
Css :: css content space 
Css :: nunito font family 
Css :: css select last character 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =