Z to spindash and up to jump which is what you use for attacking and X to spindash backwards, and use the right or left arrow to move. There are two levels sonic has to complete with enemies like Motobugs and buzz bomber, the Motobug is the easier one to beat it just walks forward, and while the buzz bomber also walks forward and he doesn't shoot he is much faster making him harder to deal with. and if you get through both of those levels you win.
This might be my hardest work yet to make even though it doesn't look like much, I hope you like it and when you get the "you loose" screen double tap the flag to get rid of it