Summary: a fully playable PocketCode app was created by an student of my courses in exactly 4 hours
During a programming course at spielend-programmieren a student of mine, Benjamin Kaut coded his first ever android app uing PocketCode in exactly 4 hours. The course was originally planned to focus on coding with Python but PocketCode turned out to be very popular.
Benjamin had seen Scratch once but had no real coding experience with visual programming languages. As i timed the Pocket-Code Sessions very exact, i can report that the whole app was coded (and teached) in 4 hours, split over 3 days.
I focused more on the “how to” because the “why” was already teached when coding with Python. I think that others can repeat the process possibly much faster. Benjamin used a Samsung Galaxy S6 Android smartphone to code. His app is optimized to make use of the 4k resolution. I still have to wrap my head around the fact that my students tiny smartphone has more screen resolution than my big pc monitor.
Here is what a description of the code, broken down into 4 parts. Please note that the parts are not equally long, the duration of each part depends on the skill and previous knowledge of the student.
[control] when program is started: [movement] set position to 0,0 [movement] set set size to 60% [control] repeat [control] if abs( inclination_x ) > 5: [movement] change x by (inclination_x * -1) [control] if abs( inclination_y ) > 5: [movement] change y by (inclination_y * -1)
[control] if x_position < -720: [movement] set x_position to -720 [control] if x_position > 720: [movement] set x_position to 720 [control] if y_position < -1280: [movement] set y_position to -1280 [control] if y_position > 1280: [movement] set y_position to 1280
[control] when program is started: [movement] set postion to ( choose a good position ) [look] make visible [control] when object is clicked (touched): [control] send message "game start"
[control] when program is started: [movement] set position to ( choose a good position ) [look] make visible [control] when object is clicked (touched): [control] send message "credits" [look] hide
[control] when program is started: [look] show "start" [control] when i recive message "credits": [look] show "credits" [control] wait 3 seconds [look] show "start"
[data] set value of "lifes" to 100 [data] set value of "points" to 0 [data] display both values at the top edge of the screen
[data] set value of "player_x" to x-position (of object) [data] set value of "player_y" to y-position (of object)
* create a new object, called "hunter", using Pocket Paint. While painting, make sure the sprite is pointing with it's nose to the right side * create script for hunter sprite:
[control] when program is started [look] set size to 60% [look] set position to 0, -500 (depending on smartphone resolution) [control] repeat [control] if random( 1, 100) < 5: [movement] glide 1 seconds to "player_x", "player_y" (change the value for "seconds" to change the difficulty of the game) [control] else [movement] point to "player" [control] when program is started [control] if abs(x-position (of object) - "player_x") < 50: [control] if abs(y-position (of object) - "player_y") < 50: [control] send message to all: "player_hit"
[<>]