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=\"Mup5f:Dc[@qhO$~X#gxb\">Timer</variable><variable type=\"\" id=\"1ZyvrP1B+|V,jj7|CaSt\">fallSpeed</variable><variable type=\"\" id=\"K2`@v%G`=H3o0[UgGH?2\">gameOver</variable><variable type=\"\" id=\"3eB@oN3o9;?@]AZClooW\">randomNumber</variable><variable type=\"\" id=\"H*6WN6d-b+pKY7H4ZPu@\">score</variable><variable type=\"\" id=\"qe*(ouP(eV,l-^2%K1Si\">gravity</variable></variables><block type=\"class_object\" id=\"`?reOappSbu,o@ED-U@I\" x=\"-195\" y=\"-45\"><field name=\"NAME\">Bird</field><statement name=\"start\"><block type=\"set_sprite\" id=\"exO1n*c!K)7?sa@4pO;7\"><value name=\"SPRITE\"><block type=\"sprite\" id=\"{cLrS}#%|yV]~Il=oK0B\"><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=\"yddc[dLDyk=b,4OXsiNF\"><field name=\"position\">y</field><value name=\"NAME\"><shadow type=\"math_number\" id=\"%^G;PF#0fXotPerg1[3O\"><field name=\"NUM\">-3</field></shadow><block type=\"variables_get_custom\" id=\"f-648HMq9lh!k{@8w$SL\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"1ZyvrP1B+|V,jj7|CaSt\" variabletype=\"\">fallSpeed</field></block></value><next><block type=\"set_pos\" id=\"XOxJ~C^_9)KshAT#sMEL\"><field name=\"position\">y</field><value name=\"NAME\"><shadow type=\"math_number\" id=\"AAdpE_w!uEa%2hy_WeAk\"><field name=\"NUM\">0</field></shadow><block type=\"math_constrain\" id=\"0PbhTU$jD?/R3ioNN0Yd\"><value name=\"VALUE\"><shadow type=\"math_number\" id=\"eH1YrYhE%kqb|G_f4PM7\"><field name=\"NUM\">50</field></shadow><block type=\"get_pos\" id=\"^SczsyL^n-p:;L_w8i7{\"><field name=\"pos\">y</field></block></value><value name=\"LOW\"><shadow type=\"math_number\" id=\"#}+@I,7+Q,/3:`-Y1b9g\"><field name=\"NUM\">-250</field></shadow></value><value name=\"HIGH\"><shadow type=\"math_number\" id=\"@YzWgj8r0Gjy%%1WWhul\"><field name=\"NUM\">250</field></shadow></value></block></value><next><block type=\"controls_if\" id=\"5P:vdqv`G18@;$pEx8DZ\"><value name=\"IF0\"><block type=\"mouse_input\" id=\"x~@C8XPoA69F44:[,N#B\"><field name=\"MOUSE\">m_left</field><field name=\"PRESSED\">key_was_pressed</field></block></value><statement name=\"DO0\"><block type=\"variables_set_custom\" id=\"#)fwI})n%!{j#_.-~jS]\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"1ZyvrP1B+|V,jj7|CaSt\" variabletype=\"\">fallSpeed</field><value name=\"VALUE\"><block type=\"math_number\" id=\"qg$7/?~p]u5``4dmq*Fe\"><field name=\"NUM\">15</field></block></value></block></statement><next><block type=\"controls_if\" id=\"Yp9_$sQ8S1`(j89^zmhe\"><value name=\"IF0\"><block type=\"collision_check\" id=\"/DxKFa-!K[pGaVq2ut5N\"><field name=\"NAME\">Column</field></block></value><statement name=\"DO0\"><block type=\"destroy\" id=\"{.r_fDKI61H.dRcVJi}u\"><value name=\"NAME\"><block type=\"self\" id=\"GgWt12TGG4MozO-;Athp\"></block></value><next><block type=\"variables_change_custom\" id=\"p6X:w_1fvmssMa,F(gNR\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"K2`@v%G`=H3o0[UgGH?2\" variabletype=\"\">gameOver</field><value name=\"VALUE\"><block type=\"logic_boolean\" id=\"KHBka0z}hCq-xr1o.~5G\"><field name=\"BOOL\">TRUE</field></block></value></block></next></block></statement><next><block type=\"controls_if\" id=\"DkYk66gYzs#R.;Z4+|3Y\"><value name=\"IF0\"><block type=\"collision_check\" id=\"gGmy#3PRZrpUz`;f:pzY\"><field name=\"NAME\">downColumn</field></block></value><statement name=\"DO0\"><block type=\"destroy\" id=\"=rs+]a%d@RZbk.Nv|d6k\"><value name=\"NAME\"><block type=\"self\" id=\",*9}cqsh5I=s^3uN]-g/\"></block></value><next><block type=\"variables_change_custom\" id=\"JMuK8Mj.a0~h37_d2KJW\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"K2`@v%G`=H3o0[UgGH?2\" variabletype=\"\">gameOver</field><value name=\"VALUE\"><block type=\"logic_boolean\" id=\"IV%y1X]EbJx2(@W7ZVC{\"><field name=\"BOOL\">TRUE</field></block></value></block></next></block></statement></block></next></block></next></block></next></block></next></block></statement></block><block type=\"class_object\" id=\"D2Jcc7,J~_jzv$4BP!x+\" x=\"345\" y=\"-15\"><field name=\"NAME\">Background</field><statement name=\"start\"><block type=\"set_sprite\" id=\"{My=@f[FiS=z}%*?.r{T\"><value name=\"SPRITE\"><block type=\"sprite\" id=\"qnL$cKC.w7yr1iWr_2sK\"><field name=\"SPRITE\">https://s3-us-west-1.amazonaws.com/media.pixelpad.io/Blockly_Assets/Space/Nebula.jpg</field></block></value></block></statement><statement name=\"update\"><block type=\"controls_if\" id=\"ClS8tyLi|82^6bY!#Usf\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"Y|%E=e6A6mx.flX@_p_{\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_custom\" id=\"[hw$DZki^}jeKKU6G=W[\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"K2`@v%G`=H3o0[UgGH?2\" variabletype=\"\">gameOver</field></block></value><value name=\"B\"><block type=\"logic_boolean\" id=\":BZ_5-*XDQcR8c[bI9or\"><field name=\"BOOL\">TRUE</field></block></value></block></value><statement name=\"DO0\"><block type=\"destroy\" id=\"5$N)c}n!4tUghmkurpk1\"><value name=\"NAME\"><block type=\"self\" id=\"yp}NpELv4OG%HUWe2uHi\"></block></value></block></statement></block></statement></block><block type=\"main_class_object\" id=\"M|TUBcRXfP-zXMfslc+k\" x=\"225\" y=\"255\"><statement name=\"start\"><block type=\"instantiate_at_pos\" id=\"YH[#!Y`X55Pm5UMj#y+r\"><field name=\"type\">Background</field><value name=\"x\"><shadow type=\"math_number\" id=\"Tc_C^)*.bSn/yi!cyeq;\"><field name=\"NUM\">0</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"v.U|-L`N0$5#AtCLYMD1\"><field name=\"NUM\">0</field></shadow></value><next><block type=\"instantiate_at_pos\" id=\"VgnB-}nre2x}auKa~K*.\"><field name=\"type\">Bird</field><value name=\"x\"><shadow type=\"math_number\" id=\"ZEKZ/KA(oBx_B?tY{Z%T\"><field name=\"NUM\">-300</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"mdSYx,M2%0^?]i%BL(pm\"><field name=\"NUM\">50</field></shadow></value><next><block type=\"variables_set_custom\" id=\"Jzj0-F)SCAwT9}{5Seuq\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"Mup5f:Dc[@qhO$~X#gxb\" variabletype=\"\">Timer</field><value name=\"VALUE\"><block type=\"math_number\" id=\":wbn^U9_W_L=07PNM4~V\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set_custom\" id=\"%sfebt))z-tfm1hizNB4\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"3eB@oN3o9;?@]AZClooW\" variabletype=\"\">randomNumber</field><value name=\"VALUE\"><block type=\"math_random_int\" id=\"zT7l)x4A#UD{O|Dk$y2g\"><value name=\"FROM\"><shadow type=\"math_number\" id=\"20!^6rgqx|Nq.CuR7/Xx\"><field name=\"NUM\">500</field></shadow></value><value name=\"TO\"><shadow type=\"math_number\" id=\"sgy$^/3:zOD-lW`i8]S4\"><field name=\"NUM\">800</field></shadow></value></block></value><next><block type=\"instantiate_at_pos\" id=\"ukORUKfPib}v[J*_nR|b\"><field name=\"type\">Column</field><value name=\"x\"><shadow type=\"math_number\" id=\"A*D_NZPd*KK%)ek2*JG1\"><field name=\"NUM\">500</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\")82p*Y$+U(vAr)s$[q=_\"><field name=\"NUM\">-500</field></shadow><block type=\"math_arithmetic\" id=\"DF}36@9tbRJYC1.h6f1F\"><field name=\"OP\">MINUS</field><value name=\"A\"><shadow type=\"math_number\" id=\"Xb0RwA[ega~Fc6DmTE+N\"><field name=\"NUM\">1</field></shadow><block type=\"variables_get_custom\" id=\"oqx+ST008.k{/26FAa=p\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"3eB@oN3o9;?@]AZClooW\" variabletype=\"\">randomNumber</field></block></value><value name=\"B\"><shadow type=\"math_number\" id=\"x8@nCie=AV66H(}}*QoO\"><field name=\"NUM\">1300</field></shadow></value></block></value><next><block type=\"variables_set_custom\" id=\"w$D|Y{k;5=.Wsd-[fZ@0\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"K2`@v%G`=H3o0[UgGH?2\" variabletype=\"\">gameOver</field><value name=\"VALUE\"><block type=\"logic_boolean\" id=\"s3cQ(;,2quq~Vn*jmZp!\"><field name=\"BOOL\">FALSE</field></block></value><next><block type=\"variables_set_custom\" id=\"m1m)6eIeJuB2/2B^;|#T\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"H*6WN6d-b+pKY7H4ZPu@\" variabletype=\"\">score</field><value name=\"VALUE\"><block type=\"math_number\" id=\"x/[B-V[EO1,]lAofX]1R\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set_custom\" id=\"OwdajS#F3vKDEsmA6!@$\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"1ZyvrP1B+|V,jj7|CaSt\" variabletype=\"\">fallSpeed</field><value name=\"VALUE\"><block type=\"math_number\" id=\"cmhN/G(3E,1D!aRQ);=`\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set_custom\" id=\"sp-G:vo:}=z`anvEQmO6\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"qe*(ouP(eV,l-^2%K1Si\" variabletype=\"\">gravity</field><value name=\"VALUE\"><block type=\"math_number\" id=\"_aN]8Wa(D!Gs}J$Wa_?N\"><field name=\"NUM\">-2</field></block></value></block></next></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=\"GbkM;c/1NfgU=RC31(_H\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"Mup5f:Dc[@qhO$~X#gxb\" variabletype=\"\">Timer</field><value name=\"VALUE\"><block type=\"math_number\" id=\"4@kX#-?Lxv=]Mxoz?Q[O\"><field name=\"NUM\">1</field></block></value><next><block type=\"controls_if\" id=\"226Rp`Ex}AhNnvv9]]*R\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"LnW_oeefN|f3*FdO.=3$\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_custom\" id=\"H@;|TG^fRXcg}5ag4Q`-\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"Mup5f:Dc[@qhO$~X#gxb\" variabletype=\"\">Timer</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"u*LPIUTH]EArU?w_%JZf\"><field name=\"NUM\">180</field></block></value></block></value><statement name=\"DO0\"><block type=\"variables_set_custom\" id=\"v@C^GnViSq{t)Ghb(r:u\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"3eB@oN3o9;?@]AZClooW\" variabletype=\"\">randomNumber</field><value name=\"VALUE\"><block type=\"math_random_int\" id=\"{%Y#n~SmOnYuB+c|i4!c\"><value name=\"FROM\"><shadow type=\"math_number\" id=\"awe:Qh;6-85T3MPShauw\"><field name=\"NUM\">500</field></shadow></value><value name=\"TO\"><shadow type=\"math_number\" id=\"$rs1ETVO,;)!wBP8(=S@\"><field name=\"NUM\">800</field></shadow></value></block></value><next><block type=\"instantiate_at_pos\" id=\"P.[L2rxbwgW%zMCX:)F[\"><field name=\"type\">Column</field><value name=\"x\"><shadow type=\"math_number\" id=\"}IG|CY3iXOu=Zez3QrW5\"><field name=\"NUM\">500</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"v4VV+F8Pa-=cG,2$55]*\"><field name=\"NUM\">-567</field></shadow><block type=\"math_arithmetic\" id=\"uMqJ7ip9bjw+lBqpuIjL\"><field name=\"OP\">MINUS</field><value name=\"A\"><shadow type=\"math_number\" id=\"8_M(-*e@VhR]i,EmTR83\"><field name=\"NUM\">1</field></shadow><block type=\"variables_get_custom\" id=\"b=Ys`sV0wWp#Ee`s)GUO\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"3eB@oN3o9;?@]AZClooW\" variabletype=\"\">randomNumber</field></block></value><value name=\"B\"><shadow type=\"math_number\" id=\"kq4a}gF-dU!4o:Qz0{94\"><field name=\"NUM\">1300</field></shadow></value></block></value><next><block type=\"variables_set_custom\" id=\"Nww3aq0[yF|||G~jbR9A\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"Mup5f:Dc[@qhO$~X#gxb\" variabletype=\"\">Timer</field><value name=\"VALUE\"><block type=\"math_number\" id=\"-5rp4El]:6_;pAN*mO10\"><field name=\"NUM\">0</field></block></value></block></next></block></next></block></statement><next><block type=\"controls_if\" id=\"y{-`Cvm!E*2#%u`u0`u@\"><value name=\"IF0\"><block type=\"key_input\" id=\"e_OipqTS~Q,Gt,GuM=9g\"><field name=\"NAME\"> </field><field name=\"PRESSED\">key_was_pressed</field></block></value><statement name=\"DO0\"><block type=\"reload_game\" id=\"^,d@(^h:`UZ:|JS::TSa\"></block></statement><next><block type=\"controls_if\" id=\"JmE|hl#0Dfpmm]-{uLxR\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"bn,z%*mIoVkK_poq}%pg\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_custom\" id=\"OZa!y0J?{(rBF}FnQI}3\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"K2`@v%G`=H3o0[UgGH?2\" variabletype=\"\">gameOver</field></block></value><value name=\"B\"><block type=\"logic_boolean\" id=\"?r8vZp9Bk@wy~A%[K`B+\"><field name=\"BOOL\">TRUE</field></block></value></block></value><statement name=\"DO0\"><block type=\"ui_text\" id=\"p@W9_41NrV--*~o}Yd_d\"><value name=\"TEXT\"><shadow type=\"text\" id=\"H,4Lro6yPEP@*M0jOUm5\"><field name=\"TEXT\">Game over. Press space to restart</field></shadow></value><value name=\"x\"><shadow type=\"math_number\" id=\"DZDd9wwp?P/p;}0ivRCZ\"><field name=\"NUM\">-200</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"(XhOG%~l+?^I;rdiNDe?\"><field name=\"NUM\">0</field></shadow></value><next><block type=\"ui_text\" id=\"{RbH2Uf#-vdG}v4KDesP\"><value name=\"TEXT\"><shadow type=\"text\" id=\"LNAzd7M`C5dh-s!++^NY\"><field name=\"TEXT\"></field></shadow><block type=\"text_join\" id=\"-gX5@:v.yTn4eiVvDt#e\"><mutation items=\"2\"></mutation><value name=\"ADD0\"><block type=\"text\" id=\"v}m3uX%)/H1.1+1x?l/s\"><field name=\"TEXT\">score </field></block></value><value name=\"ADD1\"><block type=\"variables_get_custom\" id=\"~q}U(!M@}(:8.,vU6sVj\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"H*6WN6d-b+pKY7H4ZPu@\" variabletype=\"\">score</field></block></value></block></value><value name=\"x\"><shadow type=\"math_number\" id=\"oPM,qo,/0b8%V*xw@9d5\"><field name=\"NUM\">0</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"H/y[6Uw$69s[lR[MeCn6\"><field name=\"NUM\">-150</field></shadow></value></block></next></block></statement><next><block type=\"variables_change_custom\" id=\"JIdfzLD)lR#_6#@$VFM^\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"1ZyvrP1B+|V,jj7|CaSt\" variabletype=\"\">fallSpeed</field><value name=\"VALUE\"><block type=\"variables_get_custom\" id=\"yOq(A_(7=h52Rg=zxFnH\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"qe*(ouP(eV,l-^2%K1Si\" variabletype=\"\">gravity</field></block></value></block></next></block></next></block></next></block></next></block></statement></block><block type=\"class_object\" id=\"q#};6=z1MPp4MJ^!q?lw\" x=\"-225\" y=\"465\"><field name=\"NAME\">Column</field><statement name=\"start\"><block type=\"set_sprite\" id=\"g@YyAU,yYd4?yXj2:L5$\"><value name=\"SPRITE\"><block type=\"sprite\" id=\"|i{du|?-_JyU_Qd@[;Lk\"><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=\"sG,bT9?6uNOcLmhcJy(#\"><field name=\"position\">x</field><value name=\"NAME\"><shadow type=\"math_number\" id=\":CN2C`@`iEF4%ag/FJ2@\"><field name=\"NUM\">-3</field></shadow></value><next><block type=\"controls_if\" id=\"$+xBT=.O|{s11.Y3KU0d\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"u$wP7@V]n(jGnm@?90|8\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_custom\" id=\"wi5%=ki/oEir4by{KEh:\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"K2`@v%G`=H3o0[UgGH?2\" variabletype=\"\">gameOver</field></block></value><value name=\"B\"><block type=\"logic_boolean\" id=\"#fl:.i;H+VlL),XYKzh$\"><field name=\"BOOL\">TRUE</field></block></value></block></value><statement name=\"DO0\"><block type=\"destroy\" id=\"sx]=su2IvUM`;BMDE!|f\"><value name=\"NAME\"><block type=\"self\" id=\"dc7?2sO$%0+#Tv9P?*N^\"></block></value></block></statement><next><block type=\"controls_if\" id=\"0m6uB[U~y):]^3(U0u9t\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"jt6)rEwxjX@o8,PzA/}r\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"math_number\" id=\"c6PYS69~u`d]=e-I(av9\"><field name=\"NUM\">-400</field></block></value><value name=\"B\"><block type=\"get_pos\" id=\"t%:5NC9duP+H5ke32h9F\"><field name=\"pos\">x</field></block></value></block></value><statement name=\"DO0\"><block type=\"variables_change_custom\" id=\"b,OQ7I^#fku:GhlpM,(K\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"H*6WN6d-b+pKY7H4ZPu@\" variabletype=\"\">score</field><value name=\"VALUE\"><block type=\"math_number\" id=\"QDY?tY1UWrz;So4sX.1?\"><field name=\"NUM\">1</field></block></value><next><block type=\"destroy\" id=\"?7E}5B^^pW|H3Lw-ruWi\"><value name=\"NAME\"><block type=\"self\" id=\"KLmZXN@Wg9S1~}69]?El\"></block></value></block></next></block></statement></block></next></block></next></block></statement></block></xml>"}