1. Нажмём на New Project:
2. Назавём проект simple:
3. Так выглядет среда разработки, выберем оборудование, нажмём на Choose hardware:
4. Я выберу Adafruit PyGamer:
5,. Напишим код:
scene.set_background_color(7) game.splash("Hello, World")
6. Добавим спрайт:
my_sprite = sprites.create(img(""" .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... """), SpriteKind.player)
7. Нажмём на Assets:
8. Выберем картинку, я выберу акулу:
9. Нажмём на Copy:
10. Выделим:
.................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... ....................................
11. Вставим:
.................................... .................................... .................................... ...............ccffff............... ..............cddbbbf............... .......ffffffcddbbbf................ .....ffbbbbbbbbbbbbbcfff.......ccccc ...ffbbbbbbbbcbcbbbbbcccff....cdbbbc ..fbbbbbbbbbbcbbcbbbbcccccfffcddbbc. .fbcbbbbbbbbbbcbcbbbbccccccccbdbbf.. .fbbbbbbbfffbbcbbbbbccccccccccbbcf.. .ffbb1111fffbbcbbbbcccccccbcffbccf.. ..ff111111111bbbbccccccbbbcc..fbbcf. ....ccccccc111bdbbbfddbccc.....ffbbf ........ccccccfbdbbbfcc..........fff ...............ffffff...............
12. Добавим my_sprite.set_position(5, 5):
13. Добавим controller.move_sprite(my_sprite):
Вот сам код:
scene.set_background_color(7) game.splash("Hello, World") my_sprite = sprites.create(img(""" .................................... .................................... .................................... ...............ccffff............... ..............cddbbbf............... .......ffffffcddbbbf................ .....ffbbbbbbbbbbbbbcfff.......ccccc ...ffbbbbbbbbcbcbbbbbcccff....cdbbbc ..fbbbbbbbbbbcbbcbbbbcccccfffcddbbc. .fbcbbbbbbbbbbcbcbbbbccccccccbdbbf.. .fbbbbbbbfffbbcbbbbbccccccccccbbcf.. .ffbb1111fffbbcbbbbcccccccbcffbccf.. ..ff111111111bbbbccccccbbbcc..fbbcf. ....ccccccc111bdbbbfddbccc.....ffbbf ........ccccccfbdbbbfcc..........fff ...............ffffff............... """), SpriteKind.player) my_sprite.set_position(5, 5) controller.move_sprite(my_sprite)