Slide Mechanic: Difference between revisions

From Unofficial EFPSE wiki Extended
Jump to navigation Jump to search
(Created page with "Put this to your loop_script: <pre> //DASH LOGIC// bind space dash player check rotation rotx roty degtorad=$roty degtorad+=90 degtorad*=0.0174533 dashy=COS($degtorad) dashx=SIN($degtorad) degtorad=$rotx degtorad-=90 degtorad*=0.0174533 dashz=SIN($degtorad) dash_reduct=COS($degtorad) dash_speed=900 dashz*=$dash_speed dashy*=$dash_speed dashx*=$dash_speed dashy*=$dash_reduct dashx*=$dash_reduct if $global.player_dash == 1 { player velocity set $dashx $dashy $dashz...")
 
No edit summary
 
Line 27: Line 27:
if $global.player_dash == 1 {
if $global.player_dash == 1 {
player velocity set $dashx $dashy $dashz
player velocity set $dashx $dashy $dashz
height walk 32
global.player_dash=2
global.player_dash=2
}
}
Line 32: Line 33:
if $global.player_dash == 2 {
if $global.player_dash == 2 {
dash_time+=$global.deltaTime
dash_time+=$global.deltaTime
if $dash_time >= 0.5 {
if $dash_time >= 1 {
global.player_dash=0
global.player_dash=0
dash_time=0
dash_time=0
height walk 42
}
}
}
}

Latest revision as of 01:41, 13 December 2024

Put this to your loop_script:

//DASH LOGIC//
bind space dash
player check rotation rotx roty
degtorad=$roty
degtorad+=90
degtorad*=0.0174533
dashy=COS($degtorad)
dashx=SIN($degtorad)
 
degtorad=$rotx
degtorad-=90
degtorad*=0.0174533
dashz=SIN($degtorad)
dash_reduct=COS($degtorad)
 
dash_speed=900

dashz*=$dash_speed
dashy*=$dash_speed
dashx*=$dash_speed
dashy*=$dash_reduct
dashx*=$dash_reduct

if $global.player_dash == 1 {
player velocity set $dashx $dashy $dashz
height walk 32
global.player_dash=2
}

if $global.player_dash == 2 {
dash_time+=$global.deltaTime
if $dash_time >= 1 {
global.player_dash=0
dash_time=0
height walk 42
}
}

Make a script named "dash.script" and put this inside:

if $global.player_dash == 0 {
global.player_dash=1
}

map quickreturn 2`

Now every 0.5 seconds you press space key, the player is launched with a force of 900 units per second to the direction you look at. It doesn't ignores gravity like regular dash should do but disabling gravity while giving player any velocity results in player flying out of bounds on cosmic speeds.