regex/breakout: Introduce basic paddle
Note that neither the animate script nor this script accept input yet, so the padding is static. Rather than relying on spin that would be caused from moving the paddle, we're just doing a basic adjustment based on the part of the paddle that is hit (edges change angle). Eventually the floor will trigger a game-over mode. * regex/breakout.sed: Add paddle. Intepret any non-space as ceiling/floor.breakout
parent
94280b4f6b
commit
534e18d475
|
@ -52,9 +52,17 @@ s/^\( [_-].*\)o\[##\]/\1X /
|
|||
s/^\([_-] .*\)\[##\]o/\1 X/
|
||||
|
||||
|
||||
# Ceiling, floor
|
||||
s/^\(.\?-.*_.\{81\}\)o/\1x/
|
||||
s/^\(.\?_.*\)o\(.\{81\}_\)/\1x\2/
|
||||
# Paddle sides from top (must do before ceiling/floor)
|
||||
s/^__\(.*\)o\(.\{81\}<\)/_ \1x\2/
|
||||
s/^ _\(.*\)o\(.\{82\}<\)/__\1x\2/
|
||||
|
||||
s/^_ \(.*\)o\(.\{80\}>\)/__\1x\2/
|
||||
s/^__\(.*\)o\(.\{81\}>\)/ _\1x\2/
|
||||
|
||||
|
||||
# Ceiling, floor, or middle of paddle
|
||||
s/^\(.\?-.*[^ ].\{81\}\)o/\1x/
|
||||
s/^\(.\?_.*\)o\(.\{81\}[^ ]\)/\1x\2/
|
||||
|
||||
|
||||
# Hit wall
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- .____________________________________________________________________________.
|
||||
_ .____________________________________________________________________________.
|
||||
01 | |
|
||||
| |
|
||||
| |
|
||||
|
@ -12,12 +12,12 @@
|
|||
| |
|
||||
| |
|
||||
| |
|
||||
| o |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| o |
|
||||
| |
|
||||
| <<=====>> |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|
|
Loading…
Reference in New Issue