EQ
AND
TRUE
10
WHILE
i
1
10
1
j
BREAK
0
ADD
1
1
ROOT
9
SIN
45
PI
EVEN
0
ROUND
3.1
SUM
64
10
50
1
100
1
100
item
abc
FIRST
text
abc
FROM_START
text
FROM_START
FROM_START
text
UPPERCASE
abc
BOTH
abc
abc
TEXT
abc
0
0
1
1
0
1
90
1
0.5
1
"Hello world"
0
0
5
FIRST
GET
FROM_START
SET
FROM_START
FROM_START
FROM_START
SPLIT
,
#Main Script
from processing import *
import random
import math
import time
### START ENGINE CODE
class Data:
url = "https://s3-us-west-1.amazonaws.com/media.pixelpad.io/Blockly_Assets/"
#Ivo-Engine stuff
objs = []
#object are only destroyed at the end of the frame
toBeDestroyed = []
inputkeys = {} #dict
gameWidth = 800
gameHeight = 500
refWidth = 800
refHeight = 500
scaleRatio = 1
reloadEndOfFrame = False
main = None
images = {}
#Base-class of every object to enable start & update
class MonoBehaviour:
#REGION variables
x = 0
y = 0
#used for sorting
z = 0
rot = 0
#used for z-sorting internally
prevZ = -1000
#should be changed through setScale only!
scale = 1
currAnim = None
inGameScreen = True
min_x = 0
min_y = 0
max_x = 0
max_y = 0
markForUpdateSize = False
#ENDREGION
def setAnim(self, anim):
self.currAnim = anim
def setScale(self, val):
self.scale = val
#REGION Sprites
sprite = None
def set_sprite(self, url, width = None, height = None):
if (url not in Data.images):
Data.images[url] = loadImage(Data.url + url)
self.sprite = Data.images[url]
if (width != None):
self.set_width(width)
if (height != None):
self.set_height(height)
#self.updateMinMax() should be called after...
def set_width(self, width):
self.sprite.width = width
def set_height(self, height):
self.sprite.height = height
def move_forward(self, value):
self.x += math.cos(radians(self.rot-90))*value
self.y -= math.sin(radians(self.rot-90))*value
def move_right(self, value):
self.x += math.cos(radians(self.rot))*value
self.y -= math.sin(radians(self.rot))*value
#ENDREGION
#REGION Collision
def get_real_width(self):
return self.sprite.width * self.scale
def get_real_height(self):
return self.sprite.height * self.scale
def get_min_x(self):
return self.x - self.get_real_width() * 0.5
def get_max_x(self):
return self.x + self.get_real_width() * 0.5
b
def get_min_y(self):
return self.y - self.get_real_height() * 0.5
def get_max_y(self):
return self.y + self.get_real_height() * 0.5
#TODO only objects inside the gamescreen collide?
def collisionCheck(self, objType):
if (not self.inGameScreen):
return False;
for obj in Data.objs:
if (obj.inGameScreen):
if (obj is not self and type(obj).__name__ == objType):
if (self.intersects(obj)):
return obj
return False
def intersects(self, obj2):
return not (self.get_max_x() < obj2.get_min_x() or self.get_min_x() > obj2.get_max_x() or self.get_min_y() > obj2.get_max_y() or self.get_max_y() < obj2.get_min_y())
def check_in_gamescreen(self):
return not (self.get_max_x() < -Data.refWidth * 0.5 or self.get_min_x() > Data.refWidth * 0.5 or self.get_min_y() > Data.refHeight * 0.5 or self.get_max_y() < -Data.refHeight*0.5)
#ENDREGION
#REGION base functions
def start_INTERNAL(self):
#commented since empty objects can just display nothing
self.set_sprite("Empty.png")
self.start()
def update_INTERNAL(self):
self.update()
#we use translate instead of setting the objects position, to fix rotation issues
posX = (int)((self.x+Data.refWidth*0.5)*Data.scaleRatio)
posY = (int)((-self.y+Data.refHeight*0.5)*Data.scaleRatio)
translate(posX, posY)
rotate(radians(self.rot))
#if (self.currAnim != None):
# self.newSprite = self.currAnim.play()
self.inGameScreen = self.check_in_gamescreen()
if (self.inGameScreen):
image(self.sprite, 0, 0, self.get_real_width()*Data.scaleRatio, self.get_real_height()*Data.scaleRatio)
rotate(-radians(self.rot))
translate(-posX, -posY)
#Base functions to be overridden by any class inheriting from MonoBehaviour
def start(self):
pass
def update(self):
pass
def isMouseOver(self):
return (Data.mouse.x > self.get_min_x() and Data.mouse.x < self.get_max_x() and Data.mouse.y > self.get_min_y() and Data.mouse.y < self.get_max_y())
#ENDREGION
class Anim:
images = None
frames = 0
framesPerImage = 5
imageIndex = 0
timer = 0
#FRAMES OER IMAGE IS NOT THE FRAMERATE... Confusing, sorry
def __init__(self, url, frames, framesPerImage = 3):
self.images = []
self.framesPerImage = framesPerImage
self.frames = frames
for i in range(frames):
fullUrl = Data.url + url + str(i+1) + ".png"
img = requestImage(fullUrl)
self.images.append(img)
#should be called from a MonoBehaviour every frame while playing.
#looks like this: self.newSprite = currAnim.play()
def play(self):
self.timer += 1
if (self.timer >= self.framesPerImage):
self.timer = 0
self.imageIndex += 1
if (self.imageIndex >= self.frames):
self.imageIndex = 0
return self.images[self.imageIndex]
def instantiate(objtype, posX = 0, posY = 0):
n = objtype()
n.x = posX
n.y = posY
n.start_INTERNAL()
Data.objs.append(n)
return n
def destroy(obj):
#Check if objects wasn't already marked as destroyed.
if obj not in Data.toBeDestroyed:
Data.toBeDestroyed.append(obj)
def key_is_pressed(k):
if (k not in Data.inputkeys):
return False
return Data.inputkeys[k] == 1 or Data.inputkeys[k] == 2
def key_was_pressed(k):
if (k not in Data.inputkeys):
return False
return Data.inputkeys[k] == 1
def key_was_released(k):
if (k not in Data.inputkeys):
return False
return Data.inputkeys[k] == 3
def reload_game():
Data.reloadEndOfFrame = True
#SHOULD BE CALLED AT END OF DRAW
def reload_game_immediate():
Data.reloadEndOfFrame = False
Data.objs = []
Data.inputkeys = {}
Data.main = Main()
Data.main.start()
class Main(MonoBehaviour):
def start(self):
print("No Blockly Main class")
class Global:
pass
### END ENGINE CODE
################################################################
#BLOCKLY_REPLACE
################################################################
### START HELPER CODE
#z-sorting
#bubblesort with extra check for each element if it changed
def bubbleSort(alist):
pop = 0
for passnum in range(len(alist)-1,0,-1):
if (alist[passnum].z != alist[passnum].prevZ):
for i in range(passnum):
pop += 1
if alist[i].z > alist[i+1].z:
temp = alist[i]
alist[i] = alist[i+1]
alist[i+1] = temp
alist[passnum].prevZ = alist[passnum].z
#print("Sorted " + str(pop) + " elements")
### END HELPER CODE
### START PROCESSING CODE
def setup():
#SIZE_REPLACE
size(Data.gameWidth, Data.gameHeight)
Data.scaleRatio = float(Data.gameWidth) / Data.refWidth
Data.invScaleRatio = float(1)/Data.scaleRatio
imageMode(CENTER)
frameRate(30)
textSize(32*Data.scaleRatio)
reload_game_immediate()
#run first frame right away
draw()
def draw():
background(0)
Data.mouse = PVector((mouse.x* Data.invScaleRatio-Data.refWidth*0.5), -(mouse.y * Data.invScaleRatio-Data.refHeight*0.5))
#bubbleSort(Data.objs)
Data.main.update()
for obj in Data.objs:
obj.update_INTERNAL()
#printObjs()
#if was pressed, go to is pressed now
for key in Data.inputkeys:
if (Data.inputkeys[key] == 1):
Data.inputkeys[key] = 2
#if was released, go to off now
if (Data.inputkeys[key] == 3):
Data.inputkeys[key] = 0
for obj in Data.toBeDestroyed:
Data.objs.remove(obj)
Data.toBeDestroyed = []
if (Data.reloadEndOfFrame):
reload_game_immediate()
#DevTools.showFPS()
#DevTools.printObjs()
class DevTools:
lastFrame = 0
avg = 0
nFramesToUpdate = 5
nFrame = 0
def showFPS():
DevTools.nFrame += 1
if (DevTools.nFrame >= DevTools.nFramesToUpdate):
m = millis()
deltaTime = m-DevTools.lastFrame
DevTools.lastFrame = m
DevTools.nFrame = 0
DevTools.avg = DevTools.nFramesToUpdate*1000/deltaTime
ui_text("FPS: " + str(DevTools.avg), 650, 50)
def printObjs():
#objs = ""
i = 0
j = 0
for obj in Data.objs:
#objs += str(obj.z) + ", "
i+=1
if (obj.inGameScreen):
j+=1
ui_text("Objs: " + str(i) + ", in screen: " + str(j), 450, 100)
def processKeyOrMousePress(val):
if (val not in Data.inputkeys or Data.inputkeys[val] == 0):
Data.inputkeys[val] = 1
def processKeyOrMouseRelease(val):
Data.inputkeys[val] = 3
def ui_text(txt, posX, posY):
pX = (int)((posX+Data.refWidth*0.5)*Data.scaleRatio)
pY = (int)((-posY+Data.refHeight*0.5)*Data.scaleRatio)
text(txt, pX, pY )
#Processing funcs
def keyPressed():
processKeyOrMousePress(str(keyboard.key))
def keyReleased():
processKeyOrMouseRelease(str(keyboard.key))
def mousePressed():
if (mouse.button == 37):
processKeyOrMousePress("m_left")
if (mouse.button == 39):
processKeyOrMousePress("m_right")
def mouseReleased():
if (mouse.button == 37):
processKeyOrMouseRelease("m_left")
if (mouse.button == 39):
processKeyOrMouseRelease("m_right")
run()
### END PROCESSING CODE
{"main":"<xml xmlns=\"http://www.w3.org/1999/xhtml\"><variables><variable type=\"\" id=\"V@MxfnJ#aLe[5VBYBRDc\">fallSpeed</variable><variable type=\"\" id=\"O+G(}OzCTRqPtHF.SQh@\">timer</variable><variable type=\"\" id=\"_3C+9`f5%sD*62A}GmQb\">gravity</variable><variable type=\"\" id=\"n{cgTm`m|6(w*FJuFS4)\">score</variable><variable type=\"\" id=\"z(`c/z*m8zJxP}nyDZQe\">gameOver</variable><variable type=\"\" id=\"fdDXT/^.9/itJJ8=]]E[\">OH</variable></variables><block type=\"class_object\" id=\"Jhw%Os-X;(xOcYs??cu`\" x=\"-165\" y=\"-825\"><field name=\"NAME\">downObstacle</field><statement name=\"start\"><block type=\"set_sprite\" id=\"%CBG|/p8_aS$a##/c*J%\"><value name=\"SPRITE\"><block type=\"sprite\" id=\"=XCcq-$f]nsIQHlAOz75\"><field name=\"SPRITE\">https://s3-us-west-1.amazonaws.com/media.pixelpad.io/Blockly_Assets/Flappy/ColumnSprite.png</field></block></value><next><block type=\"set_rot\" id=\"CCkB)xm{JA{=FvE:}io#\"><value name=\"NAME\"><shadow type=\"math_number\" id=\"q/}m[!RZqw9Pn_Eqj4@;\"><field name=\"NUM\">180</field></shadow></value></block></next></block></statement><statement name=\"update\"><block type=\"change_pos\" id=\"E6N?u6EIgp$o;Bn{w^o)\"><field name=\"position\">x</field><value name=\"NAME\"><shadow type=\"math_number\" id=\"_M~9}Bg}!mI*8Yyv@VGi\"><field name=\"NUM\">-8</field></shadow></value><next><block type=\"controls_if\" id=\"NE,clGqbH0ke(DwxJ]qr\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"s|g!rBLB?1F}*faD(Azx\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"get_pos\" id=\"g,q,~w_bt)UY[qZ$iW5}\"><field name=\"pos\">x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"infokAP)j8e+23}S:{i{\"><field name=\"NUM\">-500</field></block></value></block></value><statement name=\"DO0\"><block type=\"destroy\" id=\")![L/1i/XnZ*ZFdua!uh\"><value name=\"NAME\"><block type=\"self\" id=\"0zB$~z`te-3NiBjC2w(d\"></block></value></block></statement><next><block type=\"controls_if\" id=\"}OQ0OwfPYh[`@LF(z+2f\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"2Mp*vg@Hix.Y)?Z2%}Pl\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_custom\" id=\"/sR*nib,lxVYu913^)Ob\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"z(`c/z*m8zJxP}nyDZQe\" variabletype=\"\">gameOver</field></block></value><value name=\"B\"><block type=\"logic_boolean\" id=\"|u$}US/}g$iHP_`K|{W-\"><field name=\"BOOL\">TRUE</field></block></value></block></value><statement name=\"DO0\"><block type=\"destroy\" id=\"{h6gv4Our*M*LU5#:/Sw\"><value name=\"NAME\"><block type=\"self\" id=\"57{q@I$q*v=H!(O:y*oX\"></block></value></block></statement></block></next></block></next></block></statement></block><block type=\"main_class_object\" id=\"M|TUBcRXfP-zXMfslc+k\" x=\"-1035\" y=\"-735\"><statement name=\"start\"><block type=\"instantiate\" id=\"^cpq,k9NR]h|SW|e4~EI\"><field name=\"NAME\">Background</field><next><block type=\"variables_set_custom\" id=\"^fK}D-9rS_H;.!M~o64L\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"O+G(}OzCTRqPtHF.SQh@\" variabletype=\"\">timer</field><value name=\"VALUE\"><block type=\"math_number\" id=\"}xK0Pi+g!*U/TXDI@1{Y\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set_custom\" id=\"I(PB_=ls$bN5re7CJS][\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"n{cgTm`m|6(w*FJuFS4)\" variabletype=\"\">score</field><value name=\"VALUE\"><block type=\"math_number\" id=\"U`]hG)a3mV/!5?D?tn{]\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set_custom\" id=\"Mgl5JSP;-{6IFG`75wC[\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"fdDXT/^.9/itJJ8=]]E[\" variabletype=\"\">OH</field><value name=\"VALUE\"><block type=\"math_number\" id=\"_39,wh5+x^YL;QNPoKFB\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set_custom\" id=\"?OONnLdL26,]e+ghvKXP\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"z(`c/z*m8zJxP}nyDZQe\" variabletype=\"\">gameOver</field><value name=\"VALUE\"><block type=\"logic_boolean\" id=\"5@GCAGU),fYq5{ELBG=u\"><field name=\"BOOL\">FALSE</field></block></value><next><block type=\"variables_set_custom\" id=\"NFVKUa^k92Q`|2c.PaOP\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"V@MxfnJ#aLe[5VBYBRDc\" variabletype=\"\">fallSpeed</field><value name=\"VALUE\"><block type=\"math_number\" id=\"9;i)+A^O.|t)$sbY`;S3\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set_custom\" id=\"HL!*=eI0$[_{9Bf)k?au\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"_3C+9`f5%sD*62A}GmQb\" variabletype=\"\">gravity</field><value name=\"VALUE\"><block type=\"math_number\" id=\"7lO99HqQj,0sWg@.nNAW\"><field name=\"NUM\">-2</field></block></value><next><block type=\"instantiate_at_pos\" id=\"@k/W(6}#xSc}17Vv~q8g\"><field name=\"type\">Bird</field><value name=\"x\"><shadow type=\"math_number\" id=\"=|r^I@G9zf^G^^uO5d)2\"><field name=\"NUM\">-250</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"H:C4.|q*?g{QCW^dt7lW\"><field name=\"NUM\">0</field></shadow></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement><statement name=\"update\"><block type=\"variables_change_custom\" id=\"vR*{w5}/S$i{~TICcok@\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"V@MxfnJ#aLe[5VBYBRDc\" variabletype=\"\">fallSpeed</field><value name=\"VALUE\"><block type=\"variables_get_custom\" id=\"7,9^tz,QSFDmu{X*5oik\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"_3C+9`f5%sD*62A}GmQb\" variabletype=\"\">gravity</field></block></value><next><block type=\"variables_change_custom\" id=\"ezvUMJd7DdY;+,gctuV+\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"O+G(}OzCTRqPtHF.SQh@\" variabletype=\"\">timer</field><value name=\"VALUE\"><block type=\"math_number\" id=\"b`%*j5sl8#izf8p#;CZ4\"><field name=\"NUM\">1</field></block></value><next><block type=\"controls_if\" id=\"U9]aVpou7q}RhXvF#ROl\"><value name=\"IF0\"><block type=\"logic_operation\" id=\"M,A#f4^K!~0siw+CAk.v\"><field name=\"OP\">AND</field><value name=\"A\"><block type=\"logic_compare\" id=\"Wy{{cvRz+V+dQi_V3csu\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_custom\" id=\"Jjg]YHN6a6YlVpr?q?P]\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"O+G(}OzCTRqPtHF.SQh@\" variabletype=\"\">timer</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"#E3Z/Ov+ZHM%8`{Uyobh\"><field name=\"NUM\">70</field></block></value></block></value><value name=\"B\"><block type=\"logic_compare\" id=\"Pd%q7E{DaV;]LkAcvE~i\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_custom\" id=\"_Tcswf,O7!ODRMK]}N0$\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"z(`c/z*m8zJxP}nyDZQe\" variabletype=\"\">gameOver</field></block></value><value name=\"B\"><block type=\"logic_boolean\" id=\"^C2kc$QmPHI1qOvnQI7f\"><field name=\"BOOL\">FALSE</field></block></value></block></value></block></value><statement name=\"DO0\"><block type=\"variables_set_custom\" id=\"xfCfpFI_v|nv^hhaXLPO\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"fdDXT/^.9/itJJ8=]]E[\" variabletype=\"\">OH</field><value name=\"VALUE\"><block type=\"math_random_int\" id=\"W`svRtQFa!qz?u=u=zcq\"><value name=\"FROM\"><shadow type=\"math_number\" id=\"FTw_9yPxtA#x#m=LToAB\"><field name=\"NUM\">-700</field></shadow></value><value name=\"TO\"><shadow type=\"math_number\" id=\"Vz~ZNNLrbMN)QI53RVKY\"><field name=\"NUM\">-500</field></shadow></value></block></value><next><block type=\"instantiate_at_pos\" id=\"EZe,3gtYHL;n^X:QR@D=\"><field name=\"type\">Obstacle</field><value name=\"x\"><shadow type=\"math_number\" id=\"+w),M!Cbm_5n`Az:~RQ?\"><field name=\"NUM\">450</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"y-(P9]zI7W(Oy@fj}@;@\"><field name=\"NUM\">-500</field></shadow><block type=\"variables_get_custom\" id=\"+qF6Y2Qck3?Ss94KumNt\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"fdDXT/^.9/itJJ8=]]E[\" variabletype=\"\">OH</field></block></value><next><block type=\"instantiate_at_pos\" id=\"C=y|D~7o~1-:#Zr12GiH\"><field name=\"type\">downObstacle</field><value name=\"x\"><shadow type=\"math_number\" id=\"Ml^avVd5ayC2rnd:|qI`\"><field name=\"NUM\">450</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"7}#L3O0xhaEBP;W_H4Ik\"><field name=\"NUM\">0</field></shadow><block type=\"math_arithmetic\" id=\"jDte{Lp7bjhRfcacMuhg\"><field name=\"OP\">ADD</field><value name=\"A\"><shadow type=\"math_number\" id=\"Ig}J-IY@()a1KDZL9gEH\"><field name=\"NUM\">1</field></shadow><block type=\"variables_get_custom\" id=\"%bk*L7PAS_J/d2{IwMF_\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"fdDXT/^.9/itJJ8=]]E[\" variabletype=\"\">OH</field></block></value><value name=\"B\"><shadow type=\"math_number\" id=\"xm%p)8u9MpC2;?wbbhs3\"><field name=\"NUM\">1250</field></shadow></value></block></value><next><block type=\"variables_set_custom\" id=\"yM_Z!PE2ZYgA)tB:D5!8\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"O+G(}OzCTRqPtHF.SQh@\" variabletype=\"\">timer</field><value name=\"VALUE\"><block type=\"math_number\" id=\"2)F^Y,t/hc5Dzu.6D0gf\"><field name=\"NUM\">0</field></block></value></block></next></block></next></block></next></block></statement><next><block type=\"controls_if\" id=\"*U^f7/!1KJ(8!R(hK1*p\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"1sO+K~;%k!!9oX/f-)+j\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_custom\" id=\"b/0FQjG[?[-wTXWV2Rjn\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"z(`c/z*m8zJxP}nyDZQe\" variabletype=\"\">gameOver</field></block></value><value name=\"B\"><block type=\"logic_boolean\" id=\"M5aRa{[bh^QF+OW|zi+J\"><field name=\"BOOL\">TRUE</field></block></value></block></value><statement name=\"DO0\"><block type=\"ui_text\" id=\"1;{G_eu.*HUkXucwRsDg\"><value name=\"TEXT\"><shadow type=\"text\" id=\"2r%pp}$-V{rZm^x99}Eb\"><field name=\"TEXT\"></field></shadow><block type=\"text_join\" id=\"Xffbo(C7ECuHT$fJdwMt\"><mutation items=\"2\"></mutation><value name=\"ADD0\"><block type=\"text\" id=\"Q4X|An[XET+Bt%O`ux.9\"><field name=\"TEXT\">You have something in your eye. Score: </field></block></value><value name=\"ADD1\"><block type=\"variables_get_custom\" id=\"uQf[nHZ%YMNL,?iUtY/R\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"n{cgTm`m|6(w*FJuFS4)\" variabletype=\"\">score</field></block></value></block></value><value name=\"x\"><shadow type=\"math_number\" id=\"7dEZ7+O_%Ya=M@JsTWt]\"><field name=\"NUM\">-290</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"3qDUT{f+_vavD{x`^54c\"><field name=\"NUM\">0</field></shadow></value></block></statement></block></next></block></next></block></next></block></statement></block><block type=\"class_object\" id=\"eOYgNhgbHLzJC;w)SB$#\" x=\"-165\" y=\"-465\"><field name=\"NAME\">Obstacle</field><statement name=\"start\"><block type=\"set_sprite\" id=\"SQ5?0$f4kZqxFU{1cAZS\"><value name=\"SPRITE\"><block type=\"sprite\" id=\"fxHv.%b$qPwQL`98AGuq\"><field name=\"SPRITE\">https://s3-us-west-1.amazonaws.com/media.pixelpad.io/Blockly_Assets/Flappy/ColumnSprite.png</field></block></value></block></statement><statement name=\"update\"><block type=\"change_pos\" id=\"v_pOhgFyjEtT~v@xp}!h\"><field name=\"position\">x</field><value name=\"NAME\"><shadow type=\"math_number\" id=\";CiS0-0Bl|Fc698{j,7I\"><field name=\"NUM\">-8</field></shadow></value><next><block type=\"controls_if\" id=\"I9Tp@fWFH6[@KwZ,9@x]\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"Z}/xj~y-f+A)JA[.;*e_\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"get_pos\" id=\",.CI}o?9d#sW!i_DA.mq\"><field name=\"pos\">x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"2mr21`URok5~`6K*nWV3\"><field name=\"NUM\">-500</field></block></value></block></value><statement name=\"DO0\"><block type=\"destroy\" id=\"`B5*8O`#AgF{Sko$I!_7\"><value name=\"NAME\"><block type=\"self\" id=\"/GI`N;Ud(=uUay-rla_V\"></block></value><next><block type=\"variables_change_custom\" id=\"IGvL,n}nQ*5v[o@oH8A2\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"n{cgTm`m|6(w*FJuFS4)\" variabletype=\"\">score</field><value name=\"VALUE\"><block type=\"math_number\" id=\"pTNxbDhx*6*c^,[YEonk\"><field name=\"NUM\">1</field></block></value></block></next></block></statement><next><block type=\"controls_if\" id=\"zhsP|EmWV=nY95zUZM5!\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"lrYJ9uEO,+!/XyH_j;Nn\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_custom\" id=\"~DQvBkdq:m@.V!`UONC+\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"z(`c/z*m8zJxP}nyDZQe\" variabletype=\"\">gameOver</field></block></value><value name=\"B\"><block type=\"logic_boolean\" id=\"y+v=c#cVve!jGF9G(fnC\"><field name=\"BOOL\">TRUE</field></block></value></block></value><statement name=\"DO0\"><block type=\"destroy\" id=\"F7hY1FnAUL8t?O:?w18w\"><value name=\"NAME\"><block type=\"self\" id=\"E}^^X0UPg)Ft4o=yV^YK\"></block></value></block></statement></block></next></block></next></block></statement></block><block type=\"class_object\" id=\"gmb;j2SzWKcdsLEaiGD-\" x=\"-135\" y=\"-45\"><field name=\"NAME\">Background</field><statement name=\"start\"><block type=\"set_sprite\" id=\"#W{5=nmVqu{ucODWW)en\"><value name=\"SPRITE\"><block type=\"sprite\" id=\"uftk|l~d|+m@dEiEdUkU\"><field name=\"SPRITE\">https://s3-us-west-1.amazonaws.com/media.pixelpad.io/Blockly_Assets/Flappy/SkyTileSprite.png</field></block></value></block></statement><statement name=\"update\"><block type=\"controls_if\" id=\"R|d:Xgn|GV|lodXLR3MZ\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"Wk)V4vNhiq)9QT|6nY1O\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_custom\" id=\"m?F|W=m2aw^G]/x%([Vc\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"z(`c/z*m8zJxP}nyDZQe\" variabletype=\"\">gameOver</field></block></value><value name=\"B\"><block type=\"logic_boolean\" id=\"dghSMY-]fsxU;^LJcJ^~\"><field name=\"BOOL\">TRUE</field></block></value></block></value><statement name=\"DO0\"><block type=\"destroy\" id=\"aw,/$jUn/H%`7?^HX)b0\"><value name=\"NAME\"><block type=\"self\" id=\"Ok:@feGpSg2:suJ);B;?\"></block></value></block></statement></block></statement></block><block type=\"class_object\" id=\"lv=z*W*|X9#AvQAFc[fd\" x=\"-1035\" y=\"75\"><field name=\"NAME\">Bird</field><statement name=\"start\"><block type=\"set_sprite\" id=\"unPz87]2+EJ8,)pe)xt+\"><value name=\"SPRITE\"><block type=\"sprite\" id=\"$$y`OyLk|um)gKibI1Lu\"><field name=\"SPRITE\">https://s3-us-west-1.amazonaws.com/media.pixelpad.io/Blockly_Assets/Flappy/BirdHero.png</field></block></value></block></statement><statement name=\"update\"><block type=\"change_pos\" id=\"Ls{DF0KwaS/d@Fe-_EhA\"><field name=\"position\">y</field><value name=\"NAME\"><shadow type=\"math_number\" id=\"6ZS;$.cSV*Q38wh:JvJ0\"><field name=\"NUM\">1</field></shadow><block type=\"variables_get_custom\" id=\"fe(`1T@^9Wx{;;lO4=9J\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"V@MxfnJ#aLe[5VBYBRDc\" variabletype=\"\">fallSpeed</field></block></value><next><block type=\"controls_if\" id=\"rF@1gSrgBMxGsv7[a/,^\"><value name=\"IF0\"><block type=\"logic_operation\" id=\"=u6R2A{h$C:;ts8O3GDt\"><field name=\"OP\">OR</field><value name=\"A\"><block type=\"logic_operation\" id=\"W*OU!_A}0~2r3]w}U04h\"><field name=\"OP\">OR</field><value name=\"A\"><block type=\"key_input\" id=\"+/zNRbfFYP^}-}JnaE3j\"><field name=\"NAME\"> </field><field name=\"PRESSED\">key_was_pressed</field></block></value><value name=\"B\"><block type=\"key_input\" id=\"OFV-tM[}U-*$,782jjRa\"><field name=\"NAME\">w</field><field name=\"PRESSED\">key_was_pressed</field></block></value></block></value><value name=\"B\"><block type=\"mouse_input\" id=\"+_,pz`/:_?y,Ve1Xmn!=\"><field name=\"MOUSE\">m_left</field><field name=\"PRESSED\">key_was_pressed</field></block></value></block></value><statement name=\"DO0\"><block type=\"variables_set_custom\" id=\"Xd7Ov]:l+o3#xrv$[3CU\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"V@MxfnJ#aLe[5VBYBRDc\" variabletype=\"\">fallSpeed</field><value name=\"VALUE\"><block type=\"math_number\" id=\"|InLC//KrBDsK)0owZG;\"><field name=\"NUM\">15</field></block></value></block></statement><next><block type=\"controls_if\" id=\"{QpVO]T(nk4wHjqV}+6m\"><value name=\"IF0\"><block type=\"logic_operation\" id=\"HH2IBt%LX)l-_h[9#;8h\"><field name=\"OP\">OR</field><value name=\"A\"><block type=\"logic_operation\" id=\"V@`31wxP^z,RA2i(0uv!\"><field name=\"OP\">OR</field><value name=\"A\"><block type=\"collision_check\" id=\"e4x)`4RH#KNhKzu}4g9V\"><field name=\"NAME\">Obstacle</field></block></value><value name=\"B\"><block type=\"logic_compare\" id=\"h--$N!XR4Q]L%90{(jth\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"get_pos\" id=\"evQbjJfitTL0WIob^Uzk\"><field name=\"pos\">y</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"s#$6ESWB_I)S})+I`Hrz\"><field name=\"NUM\">-300</field></block></value></block></value></block></value><value name=\"B\"><block type=\"collision_check\" id=\"(_Oe7%ddt$|5ESu8_hND\"><field name=\"NAME\">downObstacle</field></block></value></block></value><statement name=\"DO0\"><block type=\"variables_set_custom\" id=\"0.RRQFvT*ib[-H.IJ9u]\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"z(`c/z*m8zJxP}nyDZQe\" variabletype=\"\">gameOver</field><value name=\"VALUE\"><block type=\"logic_boolean\" id=\"2f/O1Z;-Kns.;ptpQvZf\"><field name=\"BOOL\">TRUE</field></block></value><next><block type=\"destroy\" id=\"!$zfhq+S]yDhVt3jMQ}3\"><value name=\"NAME\"><block type=\"self\" id=\"TPQ6HNin:]ba3Uz]a*~`\"></block></value></block></next></block></statement><next><block type=\"controls_if\" id=\")4wSq)r_jl)rF.z,pW72\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"A[.S6-cnag:PsPM72MXj\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"get_pos\" id=\"-t!fu?+lgw:tT)l~aE|G\"><field name=\"pos\">y</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"/n+stPPsIH@is@0CVPb_\"><field name=\"NUM\">250</field></block></value></block></value><statement name=\"DO0\"><block type=\"set_pos\" id=\"aFVjAUyh*qa2.Uw.cEKg\"><field name=\"position\">y</field><value name=\"NAME\"><shadow type=\"math_number\" id=\"m8Li.XSe*?0F4#cNy=F]\"><field name=\"NUM\">300</field></shadow><block type=\"math_number\" id=\"^ogaOF8GvXbJCk7dv4Sb\"><field name=\"NUM\">250</field></block></value></block></statement></block></next></block></next></block></next></block></statement></block></xml>"}