# GameDev_Bitsy-LeNeant

# LeNeant

**Link to Game**: [https://illestpreacha.itch.io/leneant](https://illestpreacha.itch.io/leneant)

For this game jam, the prompt was to build a game with an engine, you haven't used before. I decided to make a game in Bitsy. Then decided to use **Hydra & SonicPi** to make a glitched version that can be played in real-time.

To get the glitch version, copy and paste the **Hydra into** another window and enjoy. If you want the audio, play the file located in this blog post.

## Video of GlitchPlay

<iframe width="560" height="315" src="https://www.youtube.com/embed/2axOjCJZOdo?si=CnGi32Ly0z2BwMfT"></iframe>

## **Audio**

<iframe width="100%" height="300" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/1674994455&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>

[IllestPreacha](https://soundcloud.com/llestreacha) · [ElectricGrowtneant](https://soundcloud.com/llestreacha/electricgrowtneant)

## Glitched Code

### Hydra

```javascript
s0.initScreen()

src(s0).kaleid().scale(0.475).diff(s0).out(o1)

src(s0).scale(2.75).rotate(0,1.80).invert([0.5,1,2.5,1,0.5]).colorama(()=> (time % 10  + 1)/9).out(o2)

src(s0).kaleid().scale(0.475).diff(src(s0).scale(4)).blend(src(s0).scale(2.5)).blend(o1).add(o2).out()

speed = 0.125
```

### **SonicPi**

```ruby
live_loop :dosage do
  use_bpm 20
  use_random_seed (Time.now.to_i)/2
  with_fx [:echo,:wobble,:krush].choose, mix: rrand(0.25,0.55) , amp: 1 do
    sample [:ambi_drone,:ambi_glass_hum,:elec_fuzz_tom,:elec_beep].choose,beat_stretch: [1,0.5,0.8].choose, rate: [0.5,0.4,0.3,0.2,0.3,0.4].tick
    sleep [0.5,1,2].choose
  end
end

sample

live_loop :bell do
  with_fx [:ixi_techno,:flanger,:ping_pong].choose, mix: rrand(0.2,0.7) do
    use_random_seed (Time.now.to_i)
    use_bpm [120,80,220].choose
    sample [:perc_bell,:elec_bell,:loop_electric].choose, rate: (rrand 0.125,1.85)
    sleep rrand(0.2,2)
  end
end



live_loop :rollback2 do
  #making true random as it goes with the actual time
  #then using the Math.cbrt to make it a different seed ratio then the above function
  use_random_seed Math.cbrt(Time.now.to_i)
  use_bpm 45
  puts Time.now.to_i
  with_fx [:echo,:whammy,:distortion].choose, mix: rrand(0.1,0.6) do
    with_fx [:ping_pong,:distortion,:krush].choose, mix: rrand(0.1,0.9) do
      sample [:perc_swoosh,:perc_swoosh,:perc_snap].choose ,beat_stretch: [1,2,3,0.5].tick, sustain: 4, rate: Math.sqrt(dice(25) + 1)/3
      sleep [0.5,1,2,4,8].choose
    end
  end
  sleep [0.5,1,2].choose
end


live_loop :rollback3 do
  #making true random as it goes with the actual time
  #then using the Math.cbrt to make it a different seed ratio then the above function
  use_random_seed Math.cbrt(Time.now.to_i)
  use_bpm [45,90,90,90,135].tick
  puts Time.now.to_i
  with_fx [:echo,:whammy,:distortion,:pitch_shift].choose, mix: rrand(0.1,0.6) do
    with_fx [:ping_pong,:distortion,:krush].choose, mix: rrand(0.1,0.9) do
      sample [:loop_mehackit1,:perc_swoosh,:glitch_robot2,:glitch_robot1].choose ,beat_stretch: [1,2,3,0.5].tick, sustain: 4, rate: Math.sqrt(dice(25) + 1)/3
      sleep [0.5,1,0.25].choose
    end
  end
  sleep [0.5,1,2].choose
end
```
