[ create a new paste ] login | about

Link: http://codepad.org/9KHI8dhm    [ raw code | fork ]

iPadtutorial909 - Lua, pasted on Jul 24:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
--# Main
-- Crane Claw

-- Use this function to perform your initial setup
function setup()
supportedOrientations(LANDSCAPE_ANY)
displayMode(FULLSCREEN)
LCM = SQUARE
start = 0
winscreen = 1
playLvlOne = 2
playLvlTwo = 3
winscreenTwo = 4
info = 5
playLvlThree = 6
winscreenThree = 7
playLvlFour = 8
winscreenFour = 9
playLvlFive = 10
winscreenFive = 11
playLvlSix = 12
winscreenSix = 13
playLvlSven = 14

crateX = 0
crateY = 0
crateBlueX = 0
crateBlueY = 0
crateYellowX = 0
crateYellowY = 0
crateTwoX = 0
crateTwoY = 0
crateBlueTwoX = 0
crateBlueTwoY = 0
crateYellowTwoX = 0
crateYellowTwoY = 0

rectDis = 0

state = start
end

-- This function gets called once every frame
function draw()
    background(59)
   
    if state == start then
    background(69)
    font("Futura-CondensedMedium")
    fill(255, 0, 0, 255)
    fontSize(125)
    text("Crane Claw", 400, 400)
    fontSize(55)
    fill(255, 255, 255, 255)
    text("Created and Developed by: \n Apple Smell Games", 300, 600)
    fontSize(50)
    noStroke()
    fill(127, 127, 127, 255)
    rect(200, 200, 100, 100)
    fill(255, 255, 255, 255)
    text("Play", 250, 250)
    fill(127, 127, 127, 255)
    rect(500, 200, 100, 100)
    fill(255, 255, 255, 255)
    text("Info", 550, 250)
    sprite("Cargo Bot:Crate Red 1", CurrentTouch.x, CurrentTouch.y)
    
    --Play!
    if CurrentTouch.x >194 and CurrentTouch.x <304 and CurrentTouch.y >194 and CurrentTouch.y <304 then
        state = playLvlOne
    end
    --Info!
    if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >194 and CurrentTouch.y <304 then
        state = info
    end
end

if state == info then
    background(255, 0, 0, 255)
    fontSize(25)
    fill(255)
    text("If there shows no goal, just place a crate on a pad. \n If there is a goal, follow it \n Somtimes there will be picture goals. \n The color brick on the picture goals means any crate \n of the same color. If you get an image in a level that looks like a wall witha curved top, \n that means any crate of that color", 355, 650)
    
    fill(127, 127, 127, 255)
    rect(300, 400, 100, 100)
    fill(0, 255, 71, 255)
    text("Back", 350, 450)
if CurrentTouch.x >294 and CurrentTouch.x <404 and CurrentTouch.y >394 and CurrentTouch.y <504 then
    state = start
    end
end

if state == playLvlOne then
    background(56)
strokeWidth(7)
stroke(255, 255, 255, 255)
lineCapMode(LCM)
if CurrentTouch.state == MOVING then
line(CurrentTouch.x, CurrentTouch.y, 700, 400)
end
--Crate
sprite("Cargo Bot:Crate Green 1", CurrentTouch.x, CurrentTouch.y)

--Goal pad
sprite("Cargo Bot:Claw Middle", 300, 100, 100, 50)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >294 and CurrentTouch.x <400 and CurrentTouch.y >94 and CurrentTouch.y <154 then
    state = winscreen
end
end
    end
    if state == winscreen then
        background(255, 255, 0, 255)
        fill(255, 0, 0, 255)
        text("Winner!", 400, 500)
        noStroke()
        fill(127, 127, 127, 255)
        rect(600, 400, 100, 100)
        fontSize(25)
        fill(0, 0, 0, 255)
        text("Next Level", 650, 450)
        if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >394 and CurrentTouch.y <504 then
        state = playLvlTwo
end
        for i = 1,3 do
        tint(0, 255, 0, 255)
        sprite("SpaceCute:Star", 200 * i, 200)
        end
    end
    if state == playLvlTwo then
        background(56)
        fill(0, 0, 0, 255)
        textWrapWidth(300)
        text("Goal: \n match the crates to the same color goal pads.", 250, 650)
  strokeWidth(7)
stroke(255, 255, 255, 255)
lineCapMode(LCM)
if CurrentTouch.state == MOVING then
line(CurrentTouch.x, CurrentTouch.y, 700, 400)
end
--Crate Red
tint(255, 0, 0, 255)
sprite("Cargo Bot:Crate Green 1", CurrentTouch.x, CurrentTouch.y)

--Goal pad Red
tint(255, 0, 0, 255)
sprite("Cargo Bot:Claw Middle", 300, 100, 100, 50)

if CurrentTouch.state == MOVING then
if CurrentTouch.x >294 and CurrentTouch.x <400 and CurrentTouch.y >94 and CurrentTouch.y <154 then
    sprite("Cargo Bot:Crate Green 1", crateX, crateY)
    crateY = 120
    crateX = 300
    end
end
if crateY == 120 and crateX == 300 then
  sprite("Cargo Bot:Crate Green 1", crateX, crateY)
--Crate Blue
tint(0, 0, 255, 255)
sprite("Cargo Bot:Crate Yellow 1", CurrentTouch.x, CurrentTouch.y)

--Goal Pad Blue
--Sorry if its a bit hard to see...
tint(0, 0, 255, 255)
sprite("Cargo Bot:Claw Middle", 500, 100, 100, 50)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >494 and CurrentTouch.x <504 and CurrentTouch.y >94 and CurrentTouch.y <154 then
    sprite("Cargo Bot:Crate Green 1", crateBlueX, crateBlueY)
    crateBlueY = 120
    crateBlueX = 500
    end
end
if crateBlueX == 500 and crateBlueY == 120 then
       sprite("Cargo Bot:Crate Green 1", crateBlueX, crateBlueY)
    
noStroke()
fill(127, 127, 127, 255)
rect(600, 500, 100, 100)
fill(255, 255, 255, 255)
fontSize(25)
text("Next", 650, 550)
if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >494 and CurrentTouch.y <604 then
    state = winscreenTwo
                end
            end
        end
    end
    if state == winscreenTwo then
        background(255, 255, 0, 255)
        fontSize(50)
        fill(255, 0, 0, 255)
        text("YOU WIN!!!", 400, 500)
        for i = 1,3 do
        tint(0, 255, 0, 255)
        sprite("SpaceCute:Star", 200 * i, 200)
        end
        fill(127, 127, 127, 255)
        rect(500, 500, 100, 100)
        fill(255, 255, 255, 255)
        text("Next", 550, 550)
if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >494 and CurrentTouch.y <604 then
   state = playLvlThree
        end
    end
    if state == playLvlThree then
        background(56)
        fontSize(25)
        text("Goal: \n Stack two green crates", 200, 650)
        
        strokeWidth(7)
stroke(255, 255, 255, 255)
lineCapMode(LCM)
if CurrentTouch.state == MOVING then
line(CurrentTouch.x, CurrentTouch.y, 700, 400)
end
--Crate
sprite("Cargo Bot:Crate Green 1", CurrentTouch.x, CurrentTouch.y)

--Goal pad
sprite("Cargo Bot:Claw Middle", 300, 100, 100, 50)

if CurrentTouch.state == MOVING then
if CurrentTouch.x >294 and CurrentTouch.x <400 and CurrentTouch.y >94 and CurrentTouch.y <154 then
    crateX = 300
    crateY = 130
    sprite("Cargo Bot:Crate Green 1", crateX, crateY)
end
end
if crateX == 300 and crateY == 130 then
    sprite("Cargo Bot:Crate Green 1", crateX, crateY)
    if CurrentTouch.state == MOVING then
    if CurrentTouch.x >294 and CurrentTouch.x <400 and CurrentTouch.y >154 and CurrentTouch.y <198 then
        crateBlueX = 300
        crateBlueY = 174
        sprite("Cargo Bot:Crate Green 1", crateBlueX, crateBlueY)
                end
            end
        end
        if crateBlueX == 300 and crateBlueY == 174 then
            sprite("Cargo Bot:Crate Green 1", crateBlueX, crateBlueY)
            noStroke()
fill(127, 127, 127, 255)
rect(600, 500, 100, 100)
fill(255, 255, 255, 255)
fontSize(25)
text("Next", 650, 550)
if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >494 and CurrentTouch.y <604 then
    state = winscreenThree
                end
        end
    end
    if state == winscreenThree then
        background(255, 255, 0, 255)
        fontSize(35)
        fill(0, 0, 0, 255)
        text("Win Win Win Win! ITS ALL YOU CAN EVER DO!", 300, 400)
        for i = 1,3 do
        tint(0, 255, 0, 255)
        sprite("SpaceCute:Star", 200 * i, 200)
        end
        fill(127, 127, 127, 255)
        rect(500, 500, 100, 100)
        fill(0, 0, 0, 255)
        text("Next", 550, 550)
        if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >494 and CurrentTouch.y <604 then
            state = playLvlFour
        end
    end
    if state == playLvlFour then
        background(56)
        fill(255, 255, 255, 255)
        text("Goal:", 500, 600)
        --Picture goal
        tint(255, 255, 255, 255)
        sprite("Cargo Bot:Goal Area", 500, 500, 200, 100)
        sprite("Cargo Bot:Crate Goal Green", 520, 470)
        sprite("Cargo Bot:Crate Goal Red", 540, 470)
        sprite("Cargo Bot:Crate Goal Red", 520, 493)
        
                strokeWidth(7)
stroke(255, 255, 255, 255)
lineCapMode(LCM)
if CurrentTouch.state == MOVING then
line(CurrentTouch.x, CurrentTouch.y, 700, 400)
end
--Crate
sprite("Cargo Bot:Crate Green 1", CurrentTouch.x, CurrentTouch.y)

--Goal pad
sprite("Cargo Bot:Claw Middle", 400, 100, 100, 50)

if CurrentTouch.state == MOVING then
if CurrentTouch.x >394 and CurrentTouch.x <504 and CurrentTouch.y >94 and CurrentTouch.y <154 then
    crateX = 400
    crateY = 130
    sprite("Cargo Bot:Crate Green 1", crateX, crateY)
            end
        end
    if crateX == 400 and crateY == 130 then
        sprite("Cargo Bot:Crate Green 1", crateX, crateY)
            sprite("Cargo Bot:Crate Red 1", CurrentTouch.x, CurrentTouch.y)
        if CurrentTouch.state == MOVING then
            if CurrentTouch.x >394 and CurrentTouch.x <504 and CurrentTouch.y >130 and CurrentTouch.y <164 then
                    crateBlueX = 400
                    crateBlueY = 164
                end
            end
            if crateBlueX == 400 and crateBlueY == 164 then
                sprite("Cargo Bot:Crate Red 1", crateBlueX, crateBlueY)
                sprite("Cargo Bot:Crate Red 2", CurrentTouch.x, CurrentTouch.y)
                if CurrentTouch.state == MOVING then
                    if CurrentTouch.x >432 and CurrentTouch.x <500 and CurrentTouch.y >94 and CurrentTouch.y <154 then
                        crateYellowX = 450
                        crateYellowY = 130
                    end
                end
            end
            if crateYellowX == 450 and crateYellowY == 130 then
                sprite("Cargo Bot:Crate Red 2", crateYellowX, crateYellowY)
                noStroke()
                fill(127, 127, 127, 255)
                rect(500, 400, 100, 100)
                fontSize(25)
                fill(255, 255, 255, 255)
                text("Next", 550, 450)
            
if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >394 and CurrentTouch.y <504 then
    state = winscreenFour
                end
            end
        end
    end
    if state == winscreenFour then
        background(255, 255, 0, 255)
        fontSize(40)
        fill(255, 255, 255, 255)
        text("Awsome!", 400, 400)
        fill(127, 127, 127, 255)
        rect(500,500, 100, 100)
        fontSize(25)
        fill(255, 255, 255, 255)
        text("Next", 550, 550)
        for i = 1,3 do
        tint(0, 255, 0, 255)
        sprite("SpaceCute:Star", 200 * i, 200)
        end
        if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >494 and CurrentTouch.y <604 then
                state = playLvlFive
        end
    end
    if state == playLvlFive then
        background(59)
        tint(255, 255, 255, 255)
                        strokeWidth(7)
stroke(255, 255, 255, 255)
lineCapMode(LCM)
if CurrentTouch.state == MOVING then
line(CurrentTouch.x, CurrentTouch.y, 700, 400)
end
--Crate
sprite("Cargo Bot:Crate Red 1", CurrentTouch.x, CurrentTouch.y)

--Goal pad
sprite("Cargo Bot:Claw Middle", 400, 100, 100, 50)
sprite("Cargo Bot:Claw Middle", 600, 100, 100, 50)
sprite("Cargo Bot:Goal Area", 500, 600, 200, 100)
sprite("Cargo Bot:Crate Goal Red", 500, 570)
sprite("Cargo Bot:Crate Goal Red", 550, 570)
sprite("Cargo Bot:Crate Goal Yellow", 500, 594)
sprite("Cargo Bot:Crate Goal Yellow", 550, 594)

LMC = PROJECT

fill(255, 255, 255, 255)
text("Goal:", 500, 700)

if CurrentTouch.state == MOVING then
if CurrentTouch.x >394 and CurrentTouch.x <504 and CurrentTouch.y >94 and CurrentTouch.y <154 then
    crateX = 400
    crateY = 134
            end
         end
        if crateX == 400 and crateY == 134 then
            sprite("Cargo Bot:Crate Red 1", crateX, crateY)
            sprite("Cargo Bot:Crate Yellow 1", CurrentTouch.x, CurrentTouch.y)
            if CurrentTouch.state == MOVING then
                if CurrentTouch.x >394 and CurrentTouch.x <504 and CurrentTouch.y >134 and CurrentTouch.y <156 then
                    crateYellowX = 400
                    crateYellowY = 176
                end
            end
        end
        if crateYellowX == 400 and crateYellowY == 176 then
            sprite("Cargo Bot:Crate Yellow 1", crateYellowX, crateYellowY)
            sprite("Cargo Bot:Crate Red 2", CurrentTouch.x, CurrentTouch.y)
            if CurrentTouch.state == MOVING then
            if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >94 and CurrentTouch.y <154 then
                crateBlueX = 600
                crateBlueY = 134
                end
            end
            if crateBlueX == 600 and crateBlueY == 134 then
                sprite("Cargo Bot:Crate Red 2", crateBlueX, crateBlueY)
                sprite("Cargo Bot:Crate Yellow 2", CurrentTouch.x, CurrentTouch.y)
                if CurrentTouch.state == MOVING then
                    if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >134 and CurrentTouch.y <156 then
                        crateTwoX = 600
                        crateTwoY = 176
                    end
                end
            end
            if crateTwoX == 600 and crateTwoY == 176 then
                sprite("Cargo Bot:Crate Yellow 2", crateTwoX, crateTwoY)
                noStroke()
                fill(127, 127, 127, 255)
                rect(600, 600, 100, 100)
                fill(255)
                text("Next", 650, 650)
if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >594 and CurrentTouch.y <704 then
    state = winscreenFive
                end
            end
        end
    end
    if state == winscreenFive then
        background(255, 255, 0, 255)
        fill(0, 0, 0, 255)
        text("Now we get a bit harder...", 400, 400)
        tint(0, 255, 0, 255)
        for i = 1,3 do
            sprite("SpaceCute:Star", 200 * i, 200)
        end
        fill(127)
        rect(500, 500, 100, 100)
        fill(255)
        text("Next", 550, 550)
        if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >494 and CurrentTouch.y <604 then
        state = playLvlSix
        end
    end
    if state == playLvlSix then
        background(59)
        fill(255)
        text("Goal: \n place a red on the green pad and a green on the red pad.", 500, 600)
        tint(255, 255, 255, 255)
        sprite("Cargo Bot:Crate Green 1", CurrentTouch.x, CurrentTouch.y)
        tint(255, 0, 0, 255)
        sprite("Cargo Bot:Claw Middle", 300, 100, 100, 50)
        tint(0, 255, 0, 255)
        sprite("Cargo Bot:Claw Middle", 500, 100, 100, 50)
              strokeWidth(7)
stroke(255, 255, 255, 255)
lineCapMode(LCM)
if CurrentTouch.state == MOVING then
line(CurrentTouch.x, CurrentTouch.y, 700, 400)
end
tint(255, 255, 255, 255)
if CurrentTouch.state == MOVING then
if CurrentTouch.x >294 and CurrentTouch.x <404 and CurrentTouch.y >94 and CurrentTouch.y <154 then
    crateX = 300
    crateY = 134
        end
    end
        if crateX == 300 and crateY == 134 then
            sprite("Cargo Bot:Crate Green 1", crateX, crateY)
            sprite("Cargo Bot:Crate Red 1", CurrentTouch.x, CurrentTouch.y)
            if CurrentTouch.state == MOVING then
            if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >94 and CurrentTouch.y <154 then
                crateBlueX = 500
                crateBlueY = 134
            end
        end
    end
    if crateBlueX == 500 and crateBlueY == 134 then
        sprite("Cargo Bot:Crate Red 1", crateBlueX, crateBlueY)
        noStroke()
        fill(127, 127, 127, 255)
        rect(600, 600, 100, 100)
        fill(255)
        text("Next", 650, 650)
        if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >594 and CurrentTouch.y <704 then
            state = winscreenSix
            end
        end
    end
    if state == winscreenSix then
        background(255, 255, 0, 255)
        fill(0, 0, 0, 255)
        text("You got this far huh? \n Lets kick up the difficulty \n in level seven.", 400, 500)
        tint(0, 255, 0, 255)
        for i = 1,3 do
            sprite("SpaceCute:Star", 200 * i, 200)
        end
        fill(127, 127, 127, 255)
    rect(500, 500, 100, 100)
    fill(255)
    text("Next", 550, 550)
    if CurrentTouch.x >494 and CurrentTouch.x <604 and CurrentTouch.y >494 and CurrentTouch.y <604 then
        state = playLvlSeven
        end
    end
    if state == playLvlSeven then
        background(59)
                    strokeWidth(7)
stroke(255, 255, 255, 255)
lineCapMode(LCM)
if CurrentTouch.state == MOVING then
line(CurrentTouch.x, CurrentTouch.y, 700, 400)
end
sprite("Cargo Bot:Crate Yellow 1", CurrentTouch.x, CurrentTouch.y)
fill(255, 255, 255, 255)
text("Goal:", 600, 700)
tint(255, 255, 255, 255)

--Goal
sprite("Cargo Bot:Goal Area", 600, 600, 200, 100)

--Hard >:)
sprite("Cargo Bot:Crate Goal Yellow", 570, 570)
sprite("Cargo Bot:Crate Goal Yellow", 600, 570)
sprite("Cargo Bot:Crate Goal Blue", 570, 600)
sprite("Cargo Bot:Crate Goal Red", 630, 570)
sprite("Cargo Bot:Crate Goal Yellow", 600, 600)
--Now we are talking almost impossible, look at info to help you a bit
sprite("Cargo Bot:Condition Yellow", 630, 600, 21, 21)

--Goal Pads
for i = 1,3 do
sprite("Cargo Bot:Claw Middle", 200 * i, 100, 100, 50)
end
--Touch function
if CurrentTouch.x >194 and CurrentTouch.x <304 and CurrentTouch.y >94 and CurrentTouch.y <154 then
    crateYellowX = 200
    crateYellowY = 134
            
        end
        if crateYellowX == 200 and crateYellowY == 134 then
            sprite("Cargo Bot:Crate Yellow 1", crateYellowX, crateYellowY)
            if CurrentTouch.state == MOVING then
                if CurrentTouch.x >394 and CurrentTouch.x <505 and CurrentTouch.y >94 and CurrentTouch.y <154 then
                    crateBlueX = 400
                    crateBlueY = 134
                end
            end
        end
     if crateBlueX == 400 and crateBlueY == 134 then
        sprite("Cargo Bot:Crate Yellow 2", crateBlueX, crateBlueY)
        sprite("Cargo Bot:Crate Yellow 3", CurrentTouch.x, CurrentTouch.y)
        if CurrentTouch.state == MOVING then
            if CurrentTouch.x >394 and CurrentTouch.x <505 and CurrentTouch.y >134 and CurrentTouch.y <156 then
                crateX = 400
                crateY = 176
                end
            end
        end
        if crateX == 400 and crateY == 176 then
            sprite("Cargo Bot:Crate Yellow 3", crateX, crateY)
            sprite("Cargo Bot:Crate Blue 1", CurrentTouch.x, CurrentTouch.y)
           if CurrentTouch.state == MOVING then
if CurrentTouch.x >194 and CurrentTouch.x <304 and CurrentTouch.y >94 and CurrentTouch.y <154 then
    crateTwoX = 200
    crateTwoY = 176

                end
            end
        end
      if crateTwoX == 200 and crateTwoY == 176 then
        sprite("Cargo Bot:Crate Blue 1", crateTwoX, crateTwoY)
        sprite("Cargo Bot:Crate Red 1", CurrentTouch.x, CurrentTouch.y)
        if CurrentTouch.state == MOVING then
        if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >94 and CurrentTouch.y <154 then
            crateBlueTwoX = 600
            crateBlueTwoY = 134
            
                end
            end
        end
        if crateBlueTwoX == 600 and crateBlueTwoY == 134 then
            sprite("Cargo Bot:Crate Red 1", crateBlueTwoX, crateBlueTwoY)
            sprite("Cargo Bot:Condition Yellow", CurrentTouch.x, CurrentTouch.y)
            
            --Lol, place down the condition for a funny ouput
            
            if CurrentTouch.state == MOVING then
if CurrentTouch.x >594 and CurrentTouch.x <704 and CurrentTouch.y >134 and CurrentTouch.y <174 then
    crateYellowTwoX = 600
    crateYellowTwoY = 176
                
                
                end
            end
        end
        if crateYellowTwoX == 600 and crateYellowTwoY == 176 then
            rectDis = rectDis + 1
           noStroke()
            if rectDis <=499 then
            fill(255, 220, 0, 255)
        
            elseif rectDis >=500 then
                fill(255, 255, 255, 0)
                 for i = 1,3 do
                sprite("Cargo Bot:Crate Yellow 3", 200 * i, 176)
            end
            end
            rect(0, 174, 1000, 50)
           
        end
    end
end

function bottomQuick()
    --My iPad laggs when going down so i use this function to get to the bottom
end
--# Participate
--You can participate with me and Apple Smell Games in our games.
--Contatct me(apple smell games owner)
--Gmail: 
--marcoman0007@gmail.com
--Twitter:
--@iPadtutorial909
--Facebook:
--Kizzy Mariason
--Youtube:
--iPadtutorial909

--Hope you do!
--We are looking for employeys with a MacBook or iMac!
--We are realeasing apps to the App Store.
--No pay for anyone until we earn enough money :(
--Hope you join! :)


Output:
No errors or program output.


Create a new paste based on this one


Comments: