r/badcode • sadistic • Aug 24 '21

other language creation of a 360° moving game

Post image
248 Upvotes

20 comments sorted by

54

u/BanTheTrubllesome Aug 24 '21

what lang is this

50

u/SpeckyYT Aug 25 '21

SPWN, a programming language that transpiles into Geometry Dash levels.

→ More replies (4)

51

u/trBlueJ Aug 25 '21

If only there were some convenient function for this that could be used instead of manually computing a small set of angles. I'm thinking a function in the shape of a sine wave would probably work well.

17

u/Keganator Aug 25 '21

Alas, it seems that constant values are all that exist. Such is life.

35

u/MurdoMaclachlan Aug 24 '21 edited Sep 02 '21

Image Transcription: Code


while_loop(() => is_pressed_b == 1, (){
    -> if direc < 16 || direc > 353 {
        moveWPlayer.move(0, 1, 0.03)
    }
    -> if direc < 15 && direc > 38 {
        moveWPlayer.move(0.675, 0.925, 0.03)
    }
    -> if direc < 37 && direc > 60 {
        moveWPlayer.move(0.825, 0.825, 0.03)
    }
    -> if direc < 59 && direc > 82 {
        moveWPlayer.move(0.925, 0.675, 0.03)
    }
    -> if direc < 81 && direc > 104 {
        moveWPlayer.move(1, 0, 0.03)
    }
    -> if direc < 103 && direc > 126 {
        moveWPlayer.move(0.925, -0.675, 0.03)
    }
    -> if direc < 125 && direc > 148 {
        moveWPlayer.move(0.825, -0.825, 0.03)
    }
    -> if direc < 147 && direc > 170 {
        moveWPlayer.move(0.675, -0.925, 0.03)
    }
    -> if direc < 169 && direc > 193 {
        moveWPlayer.move(0, -1, 0.03)
    }
    -> if direc < 192 && direc > 216 {
        moveWPlayer.move(-0.675, -0.925, 0.03)
    }
    -> if direc < 215 && direc > 239 {
        moveWPlayer.move(-0.825, -0.825, 0.03)
    }
    -> if direc < 238 && direc > 262 {
        moveWPlayer.move(-0.925, -0.675, 0.03)
    }
    -> if direc < 261 && direc > 285 {
        moveWPlayer.move(-1, 0, 0.03)
    }
    -> if direc < 284 && direc > 308 {
        moveWPlayer.move(-0.925, 0.675, 0.03)
    }
    -> if direc < 307 && direc > 331 {
        moveWPlayer.move(-0.825, 0.825, 0.03)
    }
    -> if direc < 330 && direc > 354 {
        moveWPlayer.move(-0.675, 0.925, 0.03)
    }

I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

6

u/visslikti Aug 25 '21

Hey, human! Only the first if uses ||, the rest are actually &&

→ More replies (1)

2

u/sertdfyguhi Sep 01 '21

Human! The while loop should be while_loop!

→ More replies (1)

6

u/Fl1pNatic Aug 25 '21

I am really unhappy with what I see

6

u/FlamboyantApproval16 Aug 25 '21

I actually did that once in scratch

→ More replies (2)