Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Variables used:
- G_pw = argument0;
- sp_v = 0;
- sp_v_round = 0;
- sp_h = 0;
- sp_h_round = 0;
- sp_h_max = 0
- still = true
- code:
- if place_free(x,y+1) {
- sp_v = sp_v + G_pw;
- }
- else {
- if sp_v > 0 {
- sp_v = 0
- }
- }
- if not place_free(x,y-1) and sp_v<0 {
- sp_v=0
- }
- sp_v_round = round(sp_v);
- if sp_v_round != 0 {
- if sp_v_round > 0 {
- for (i = sp_v_round; i>0; i-=1) {
- if place_free(x,y+i) {
- y+=i
- i=0
- }
- }
- }
- else {
- for (i = sp_v_round; i<0; i+=1) {
- if place_free(x,y+i) {
- y+=i
- i=0
- }
- }
- }
- }
- if still {
- sp_h_max = 0
- }
- if sp_h > sp_h_max or sp_h < sp_h_max * -1 {
- if sp_h !=0 {
- if sp_h>0 {
- if place_free(x,y+1) {
- if sp_h > 0.5 {
- sp_h-=0.5
- }
- else {
- sp_h=0
- }
- }
- else {
- if sp_h > 1 {
- sp_h-=1
- }
- else {
- sp_h=0
- }
- }
- }
- else {
- if place_free(x,y+1) {
- if sp_h < -0.5 {
- sp_h+=0.5
- }
- else {
- sp_h=0
- }
- }
- else
- if sp_h < -1 {
- sp_h+=1
- }
- else {
- sp_h=1
- }
- }
- }
- }
- sp_h_round = round(sp_h)
- if sp_h_round != 0 {
- if sp_h_round > 0 {
- for (i = sp_h_round; i>0; i-=1) {
- if place_free(x+i,y) {
- x+=i
- i=0
- }
- }
- }
- else {
- for (i = sp_h_round; i<0; i+=1) {
- if place_free(x+i,y) {
- x+=i
- i=0
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement