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=\"Iz]*h!=Uj5gtk}gI{JPk\">timer</variable><variable type=\"\" id=\"CEX$]6VT/eUDgB!GBYQW\">columnSpeed</variable><variable type=\"\" id=\"6z`^KH5e2H8WqxRE!jGm\">fallSpeed</variable><variable type=\"\" id=\"c/r632.;tQN09`lMKGgX\">randomNumber</variable><variable type=\"\" id=\"M{Bm1hd!.Y/`l/Dm0qeD\">gameOver</variable><variable type=\"\" id=\"9Pv-CS}Z9eLtz[Gg:F;,\">score</variable><variable type=\"\" id=\";h-1ak=DUC~#;K|SqcDF\">gravity</variable></variables><block type=\"main_class_object\" id=\"M|TUBcRXfP-zXMfslc+k\" x=\"-315\" y=\"-525\"><statement name=\"start\"><block type=\"instantiate_at_pos\" id=\"vM`0(VG@B_jbg#3B3dg|\"><field name=\"type\">Background</field><value name=\"x\"><shadow type=\"math_number\" id=\"3i@@NyDJ.Gb0U4/oviAu\"><field name=\"NUM\">0</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"I(P27_{um_sI2)IOk~_e\"><field name=\"NUM\">0</field></shadow></value><next><block type=\"instantiate_at_pos\" id=\"qxPPXAc|if-C)%_KPn6v\"><field name=\"type\">Bird</field><value name=\"x\"><shadow type=\"math_number\" id=\"L:n17szA117qEub%bt87\"><field name=\"NUM\">-300</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"94x=C^Jq=_]R8k$NdE~d\"><field name=\"NUM\">0</field></shadow></value><next><block type=\"variables_set_custom\" id=\"_sP97d,8~!S1p8HZ~hm?\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"Iz]*h!=Uj5gtk}gI{JPk\" variabletype=\"\">timer</field><value name=\"VALUE\"><block type=\"math_number\" id=\"XrOBJbfD}F-i2MiH))S%\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set_custom\" id=\"No0;d;DIx1V6gqh?0Cb^\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"c/r632.;tQN09`lMKGgX\" variabletype=\"\">randomNumber</field><value name=\"VALUE\"><block type=\"math_random_int\" id=\"Fp2zxH${/.Ld7/Q}@=}a\"><value name=\"FROM\"><shadow type=\"math_number\" id=\"e?tt]/zZPZHz{}s@1`Wv\"><field name=\"NUM\">500</field></shadow></value><value name=\"TO\"><shadow type=\"math_number\" id=\"Gsdw5x`3mXm^I*E8F-)q\"><field name=\"NUM\">800</field></shadow></value></block></value><next><block type=\"instantiate_at_pos\" id=\"dhkk`zGVC%|ofmTd:?va\"><field name=\"type\">Column</field><value name=\"x\"><shadow type=\"math_number\" id=\":c~TmLI64)KTYfUTj?L[\"><field name=\"NUM\">500</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"P=2]iFu$f@=T?{;-paeA\"><field name=\"NUM\">-600</field></shadow><block type=\"math_arithmetic\" id=\":2edF8*AIMfnm6`2{p1(\"><field name=\"OP\">MINUS</field><value name=\"A\"><shadow type=\"math_number\" id=\",}m|]noA3:qp}GLh7H+S\"><field name=\"NUM\">1</field></shadow><block type=\"variables_get_custom\" id=\"CV#~$N0!1Eseh#owAoDK\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"c/r632.;tQN09`lMKGgX\" variabletype=\"\">randomNumber</field></block></value><value name=\"B\"><shadow type=\"math_number\" id=\"onu.L2r..{lxR?],W(NX\"><field name=\"NUM\">1300</field></shadow></value></block></value><next><block type=\"instantiate_at_pos\" id=\".f$2|ZR_FUY)1-cdkML:\"><field name=\"type\">downColumn</field><value name=\"x\"><shadow type=\"math_number\" id=\"BZwVLCPKx7xC@Zj!.enp\"><field name=\"NUM\">500</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"SX+(D[c+pv*-:k~H]EOO\"><field name=\"NUM\">600</field></shadow><block type=\"variables_get_custom\" id=\"~e3-tuJ~(i$,;M7?|rlr\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"c/r632.;tQN09`lMKGgX\" variabletype=\"\">randomNumber</field></block></value><next><block type=\"variables_set_custom\" id=\"1avtH[l?fg,7f+*~DN_0\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"M{Bm1hd!.Y/`l/Dm0qeD\" variabletype=\"\">gameOver</field><value name=\"VALUE\"><block type=\"logic_boolean\" id=\"ZOT{*EWwnq@,y8L|CXwp\"><field name=\"BOOL\">FALSE</field></block></value><next><block type=\"variables_set_custom\" id=\"lQw{s}y/0pB^hNYmG7Xf\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"9Pv-CS}Z9eLtz[Gg:F;,\" variabletype=\"\">score</field><value name=\"VALUE\"><block type=\"math_number\" id=\"t%2jwDVQ]*KlVS]D|MQr\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set_custom\" id=\"]IS;eHhJ#e-/O]#0{nzm\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"6z`^KH5e2H8WqxRE!jGm\" variabletype=\"\">fallSpeed</field><value name=\"VALUE\"><block type=\"math_number\" id=\"cOPx!-{eL|ubSe:[S*:t\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set_custom\" id=\"t*DfJHu7`oWuTk0bB?DM\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\";h-1ak=DUC~#;K|SqcDF\" variabletype=\"\">gravity</field><value name=\"VALUE\"><block type=\"math_number\" id=\"1:f|}6/Q2(0x{U,p*_RS\"><field name=\"NUM\">-2</field></block></value><next><block type=\"variables_set_custom\" id=\"ECRwt?iHvTErORf$gxKN\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"CEX$]6VT/eUDgB!GBYQW\" variabletype=\"\">columnSpeed</field><value name=\"VALUE\"><block type=\"math_number\" id=\"EcS~lJP8apHC9L*c_H/-\"><field name=\"NUM\">-5</field></block></value></block></next></block></next></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=\"HCaWd.(-^.xVyC+uAXU@\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"Iz]*h!=Uj5gtk}gI{JPk\" variabletype=\"\">timer</field><value name=\"VALUE\"><block type=\"math_number\" id=\";G2jD!v;Bl|{@x$6XzoY\"><field name=\"NUM\">1</field></block></value><next><block type=\"controls_if\" id=\":^wrAQ)$i0d_?C9nd4$B\"><value name=\"IF0\"><block type=\"logic_compare\" id=\")y/b3H%rl5$$di$U*M,V\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_custom\" id=\"97])y;T::7hq%c(h+-w-\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"Iz]*h!=Uj5gtk}gI{JPk\" variabletype=\"\">timer</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"Tyd$BU[Nyap9^7V}p_Cu\"><field name=\"NUM\">60</field></block></value></block></value><statement name=\"DO0\"><block type=\"variables_set_custom\" id=\"*/LeDgQcCRPqoqsrH95}\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"c/r632.;tQN09`lMKGgX\" variabletype=\"\">randomNumber</field><value name=\"VALUE\"><block type=\"math_random_int\" id=\"oa]TfjWjA)T0a990mrXp\"><value name=\"FROM\"><shadow type=\"math_number\" id=\"%rs9mmV$/U5n1?2`zJ1p\"><field name=\"NUM\">500</field></shadow></value><value name=\"TO\"><shadow type=\"math_number\" id=\"J@%;VV]RzK^pPRI{+$cJ\"><field name=\"NUM\">800</field></shadow></value></block></value><next><block type=\"instantiate_at_pos\" id=\"X+@,oQP|},TU%pD]GlLq\"><field name=\"type\">Column</field><value name=\"x\"><shadow type=\"math_number\" id=\"GJ-B9]PT[R9i2#=Vr=0Y\"><field name=\"NUM\">500</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"P=2]iFu$f@=T?{;-paeA\"><field name=\"NUM\">-600</field></shadow><block type=\"math_arithmetic\" id=\"dOXIEa(y9L@c6}X#7Krd\"><field name=\"OP\">MINUS</field><value name=\"A\"><shadow type=\"math_number\" id=\",}m|]noA3:qp}GLh7H+S\"><field name=\"NUM\">1</field></shadow><block type=\"variables_get_custom\" id=\"{zw/M;ZQKY$!udD#q;eX\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"c/r632.;tQN09`lMKGgX\" variabletype=\"\">randomNumber</field></block></value><value name=\"B\"><shadow type=\"math_number\" id=\"2`}/aJ#r%u)QWp@LW]bI\"><field name=\"NUM\">1300</field></shadow></value></block></value><next><block type=\"instantiate_at_pos\" id=\"p^Pa3fvej!t/^BQ:*9*X\"><field name=\"type\">downColumn</field><value name=\"x\"><shadow type=\"math_number\" id=\"R9f~Cxgl[-o}xJ;Z!VYN\"><field name=\"NUM\">500</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"SX+(D[c+pv*-:k~H]EOO\"><field name=\"NUM\">600</field></shadow><block type=\"variables_get_custom\" id=\"O8V}eQP+]:2Mv|tP%t(d\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"c/r632.;tQN09`lMKGgX\" variabletype=\"\">randomNumber</field></block></value><next><block type=\"variables_set_custom\" id=\"!qUYaWXz(*s}{#=EHo){\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"Iz]*h!=Uj5gtk}gI{JPk\" variabletype=\"\">timer</field><value name=\"VALUE\"><block type=\"math_number\" id=\"+jjz?maRx+rKJ+qX:~X5\"><field name=\"NUM\">0</field></block></value></block></next></block></next></block></next></block></statement><next><block type=\"controls_if\" id=\"_(_m6Pp,AizviR!hEnq6\"><value name=\"IF0\"><block type=\"key_input\" id=\"HgowGphZ@QJO.3S=F4T%\"><field name=\"NAME\"> </field><field name=\"PRESSED\">key_was_pressed</field></block></value><statement name=\"DO0\"><block type=\"reload_game\" id=\"6_S)T_pwq|%fa;p(ZQ}[\"></block></statement><next><block type=\"controls_if\" id=\":WTu@f.%XZa.d~*4_205\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"uI$AxaGrj[bo0X:!De#%\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_custom\" id=\"%UcR^LeKf,3X~@Z-31.s\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"M{Bm1hd!.Y/`l/Dm0qeD\" variabletype=\"\">gameOver</field></block></value><value name=\"B\"><block type=\"logic_boolean\" id=\"Z65hpUh;f-=/#tZ.O(Fx\"><field name=\"BOOL\">TRUE</field></block></value></block></value><statement name=\"DO0\"><block type=\"ui_text\" id=\"jZ@|#TOSJshUB(ck4j+1\"><value name=\"TEXT\"><shadow type=\"text\" id=\"yHt-i~z/Y?}^cA52b3Sc\"><field name=\"TEXT\">Press space to restart the game</field></shadow></value><value name=\"x\"><shadow type=\"math_number\" id=\"FXi:50Vs8mV=`T_9/fWq\"><field name=\"NUM\">-200</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"Tx4JpOPc4JRMj-Kqkv+~\"><field name=\"NUM\">0</field></shadow></value><next><block type=\"ui_text\" id=\"1NPj5+].,@HdaEz}l)`p\"><value name=\"TEXT\"><shadow type=\"text\" id=\";3TcaCXiQ_]waq}xV]%^\"><field name=\"TEXT\"></field></shadow><block type=\"text_join\" id=\"M?s=M~ivRmw``rhNWpE7\"><mutation items=\"2\"></mutation><value name=\"ADD0\"><block type=\"text\" id=\"zUGZwmhkHNV@wNT82mMp\"><field name=\"TEXT\">Your score is: </field></block></value><value name=\"ADD1\"><block type=\"variables_get_custom\" id=\"XOJB^g@-alBSgp62Xzq0\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"9Pv-CS}Z9eLtz[Gg:F;,\" variabletype=\"\">score</field></block></value></block></value><value name=\"x\"><shadow type=\"math_number\" id=\"$vvDp2|?_5]13_YsN(Y3\"><field name=\"NUM\">0</field></shadow></value><value name=\"y\"><shadow type=\"math_number\" id=\"c6?[Z}9{]XT3+!X-OMWg\"><field name=\"NUM\">-150</field></shadow></value></block></next></block></statement><next><block type=\"variables_change_custom\" id=\"SLWc_)q#0HXO5X0G2a2q\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"6z`^KH5e2H8WqxRE!jGm\" variabletype=\"\">fallSpeed</field><value name=\"VALUE\"><block type=\"variables_get_custom\" id=\"ch)P~jVQAgX8p+c9ovkC\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\";h-1ak=DUC~#;K|SqcDF\" variabletype=\"\">gravity</field></block></value></block></next></block></next></block></next></block></next></block></statement></block><block type=\"class_object\" id=\"}O+ATgfWye1Yix4]2EKg\" x=\"435\" y=\"-45\"><field name=\"NAME\">downColumn</field><statement name=\"start\"><block type=\"set_sprite\" id=\"QO/dB?FeZ6yGe_P?}Lc?\"><value name=\"SPRITE\"><block type=\"sprite\" id=\"XJ}gY]ZtM0DT(9::Duv.\"><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=\"kS9`hu_qv0#fXE-!tJ,N\"><field name=\"position\">x</field><value name=\"NAME\"><shadow type=\"math_number\" id=\"S@Z1!NL{YBU!NCKs}q,.\"><field name=\"NUM\">-10</field></shadow><block type=\"variables_get_custom\" id=\"+KNY9+c)5=3|v;acw5wD\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"CEX$]6VT/eUDgB!GBYQW\" variabletype=\"\">columnSpeed</field></block></value><next><block type=\"set_rot\" id=\"8(%We7h/ebSB:^rB-=*?\"><value name=\"NAME\"><shadow type=\"math_number\" id=\"JOs}X[B%#,kO[7Tw8;Bm\"><field name=\"NUM\">180</field></shadow></value><next><block type=\"controls_if\" id=\"@!vS|QxfC~5=@pVxd}j8\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"Gi`!3XLM@WzcP*}3?waZ\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_custom\" id=\"woJQ.N;keZP@BXfEYTHu\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"M{Bm1hd!.Y/`l/Dm0qeD\" variabletype=\"\">gameOver</field></block></value><value name=\"B\"><block type=\"logic_boolean\" id=\"K7YutMFLSgfwDKFa8A:)\"><field name=\"BOOL\">TRUE</field></block></value></block></value><statement name=\"DO0\"><block type=\"destroy\" id=\"WDvHLY9UfL2AY|jF)YI_\"><value name=\"NAME\"><block type=\"self\" id=\"?AJ16/(q#)[tw~jTCWXo\"></block></value></block></statement></block></next></block></next></block></statement></block><block type=\"class_object\" id=\"Q~eJF~5o4XOxo;3S=qnG\" x=\"435\" y=\"225\"><field name=\"NAME\">Column</field><statement name=\"start\"><block type=\"set_sprite\" id=\"F0~[L;Y:^yZneb_5d2iM\"><value name=\"SPRITE\"><block type=\"sprite\" id=\"WclK$)TX7.,9V]HAf/_K\"><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=\"yn),k+JGkcV$kS/H^JWb\"><field name=\"position\">x</field><value name=\"NAME\"><shadow type=\"math_number\" id=\"EF{szr|QpZ[rBBVbaGIh\"><field name=\"NUM\">-10</field></shadow><block type=\"variables_get_custom\" id=\"V*g$FYIgeA5C098s+bcz\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"CEX$]6VT/eUDgB!GBYQW\" variabletype=\"\">columnSpeed</field></block></value><next><block type=\"controls_if\" id=\"!/?1=@Ap@X8tps%y|ErY\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"/*pxR[@:C%+}r$ABne]e\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_custom\" id=\"TWuv}$HJ4mQmfn5~(QL$\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"M{Bm1hd!.Y/`l/Dm0qeD\" variabletype=\"\">gameOver</field></block></value><value name=\"B\"><block type=\"logic_boolean\" id=\"*fG}{;$.uR;EVDpJ`Z5z\"><field name=\"BOOL\">TRUE</field></block></value></block></value><statement name=\"DO0\"><block type=\"destroy\" id=\")./x{6?]e%2Wx2PxA$AO\"><value name=\"NAME\"><block type=\"self\" id=\"UjMWS-Qqo,x#k{ec{|IJ\"></block></value></block></statement><next><block type=\"controls_if\" id=\"!1K05t[*CT3K}|qQXS-q\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"a31k,Zodte/p$9g)A3fb\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"get_pos\" id=\"EOGS@j5$5zy7TxQH3OIQ\"><field name=\"pos\">x</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"M0,gU;VJnt*;LC2/j1s4\"><field name=\"NUM\">-400</field></block></value></block></value><statement name=\"DO0\"><block type=\"variables_change_custom\" id=\"=Aiyra-|aV]N18T@!arl\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"9Pv-CS}Z9eLtz[Gg:F;,\" variabletype=\"\">score</field><value name=\"VALUE\"><block type=\"math_number\" id=\"nf`#W(|uTcoe/c]b#X]P\"><field name=\"NUM\">1</field></block></value><next><block type=\"variables_change_custom\" id=\"CFO]q7pM;T?;%fVmVn0o\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"CEX$]6VT/eUDgB!GBYQW\" variabletype=\"\">columnSpeed</field><value name=\"VALUE\"><block type=\"math_number\" id=\"WTh-LwrlremX3Sl$0*mx\"><field name=\"NUM\">-2</field></block></value><next><block type=\"destroy\" id=\"AP0hn6kJ`2oP#4d-3a%9\"><value name=\"NAME\"><block type=\"self\" id=\"{qE1hQ.`x{*|XKY$!q4/\"></block></value></block></next></block></next></block></statement></block></next></block></next></block></statement></block><block type=\"class_object\" id=\"?R(H9Ayi6EpNdtucyWy!\" x=\"-285\" y=\"555\"><field name=\"NAME\">Bird</field><statement name=\"start\"><block type=\"set_sprite\" id=\"Q|?{O~H9}mo/tsAP(F#L\"><value name=\"SPRITE\"><block type=\"sprite\" id=\"{qwl+Np6YTOy$Z3cIp;s\"><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=\"c9Ru[vG|i2d1hB:gmy|m\"><field name=\"position\">y</field><value name=\"NAME\"><shadow type=\"math_number\" id=\"4!2Y_-@T7N~!QwxwXku*\"><field name=\"NUM\">-5</field></shadow><block type=\"variables_get_custom\" id=\"|?_^Oy:IZ9Rc|~{J]lF7\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"6z`^KH5e2H8WqxRE!jGm\" variabletype=\"\">fallSpeed</field></block></value><next><block type=\"set_pos\" id=\"]0Az`]%35nMmr!E4/Oa~\"><field name=\"position\">y</field><value name=\"NAME\"><shadow type=\"math_number\" id=\"5.~Kx(;{yB.cdpr:kP6v\"><field name=\"NUM\">0</field></shadow><block type=\"math_constrain\" id=\")i?Gy)WH#`B.Pp=?t_k*\"><value name=\"VALUE\"><shadow type=\"math_number\" id=\"~:D!?CT@dJ(,Q5X;VkLH\"><field name=\"NUM\">50</field></shadow><block type=\"get_pos\" id=\"CBLrZ@1tph!*hsj`cl#C\"><field name=\"pos\">y</field></block></value><value name=\"LOW\"><shadow type=\"math_number\" id=\"dAkD_xP+bfzA1oKEb/e1\"><field name=\"NUM\">-250</field></shadow></value><value name=\"HIGH\"><shadow type=\"math_number\" id=\"50;nr}Bd8`w%qdI{%Dv+\"><field name=\"NUM\">250</field></shadow></value></block></value><next><block type=\"controls_if\" id=\"iYw}qr6OM^6|nI1/^Ph.\"><value name=\"IF0\"><block type=\"mouse_input\" id=\"!?d)M=i7_pYU7O,,cD^q\"><field name=\"MOUSE\">m_left</field><field name=\"PRESSED\">key_was_pressed</field></block></value><statement name=\"DO0\"><block type=\"variables_set_custom\" id=\"$)[c2#XxbyJyPTExD}0a\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"6z`^KH5e2H8WqxRE!jGm\" variabletype=\"\">fallSpeed</field><value name=\"VALUE\"><block type=\"math_number\" id=\"hPTD18,vL#-0M*-y)vZy\"><field name=\"NUM\">15</field></block></value></block></statement><next><block type=\"controls_if\" id=\"|~F2iInk-96xUxs,KN?p\"><value name=\"IF0\"><block type=\"collision_check\" id=\"Fpt0SoC[ncPn8g/-alI*\"><field name=\"NAME\">Column</field></block></value><statement name=\"DO0\"><block type=\"destroy\" id=\"z7?.nq}x(7d5KnSR{}~h\"><value name=\"NAME\"><block type=\"self\" id=\"bPs__?Iv;Squ#aGC|-a0\"></block></value><next><block type=\"variables_change_custom\" id=\"tc:U$KzH#jRUGL$pr3rL\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"M{Bm1hd!.Y/`l/Dm0qeD\" variabletype=\"\">gameOver</field><value name=\"VALUE\"><block type=\"logic_boolean\" id=\"dQHsQsupkSFc_2je:vE;\"><field name=\"BOOL\">TRUE</field></block></value></block></next></block></statement><next><block type=\"controls_if\" id=\",3+b@(n9?7v@:|kfot]S\"><value name=\"IF0\"><block type=\"collision_check\" id=\",!dg/V#Y;{2{|gZ([C(}\"><field name=\"NAME\">downColumn</field></block></value><statement name=\"DO0\"><block type=\"destroy\" id=\"!73Dl7r#B],C4/?`U5]3\"><value name=\"NAME\"><block type=\"self\" id=\"$:xE%t2q(F})^p79*wF]\"></block></value><next><block type=\"variables_change_custom\" id=\"V_jx,HisJn2^%$?2#p+*\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"M{Bm1hd!.Y/`l/Dm0qeD\" variabletype=\"\">gameOver</field><value name=\"VALUE\"><block type=\"logic_boolean\" id=\"Ntor@EQYI$MR@Hc[w0bz\"><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=\"(+D|vEVYZtC$w/t%%[sS\" x=\"435\" y=\"795\"><field name=\"NAME\">Background</field><statement name=\"start\"><block type=\"set_sprite\" id=\"kq!0-!Q#,-T=TF@J;x79\"><value name=\"SPRITE\"><block type=\"sprite\" id=\"zGIw[Gw;ZV7=r61m-GKl\"><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=\"hE-/A;zk$X9O+HsTH2M5\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"FqA$BHA4X7g#a)wl;V$7\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"variables_get_custom\" id=\"QSJGoWAsDE/{KP@XJCC=\"><field name=\"TYPE\">Global.</field><field name=\"VAR\" id=\"M{Bm1hd!.Y/`l/Dm0qeD\" variabletype=\"\">gameOver</field></block></value><value name=\"B\"><block type=\"logic_boolean\" id=\"W3Y,=kqI_Bxb{#vil7zE\"><field name=\"BOOL\">TRUE</field></block></value></block></value><statement name=\"DO0\"><block type=\"destroy\" id=\"8e64VVBs(`ZEOrAQIu6w\"><value name=\"NAME\"><block type=\"self\" id=\"Qud~o9}5Bj23%-:en}!0\"></block></value></block></statement></block></statement></block></xml>"}