-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeneral.lua
More file actions
652 lines (634 loc) · 22.2 KB
/
general.lua
File metadata and controls
652 lines (634 loc) · 22.2 KB
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
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
local t = {}--gestion du general
--
t.general = function ()
local compteuropt=0
--print("123")
local function testautorisation(self)
local autorise=1
if self.y+30<mayminuspos2+30 or self.y+30>maypos2-30 or self.x<maxminuspos2+30 or self.x>maxpos2-30 then
autorise=2
end
if autorise==1 then
if modezombie or modepanique then
autorise=0
if autorise==0 then
local i=1
while i<=obstaclenb do
--for i=1,obstaclenb,1 do--wandrille le 11 correspond au nb de point de collision (obstacle)------------------------------------------------------------------------------------------------------------
if 3000>((self.x-obstacle[i].x)*(self.x-obstacle[i].x)+(self.y+30-obstacle[i].y)*(self.y+30-obstacle[i].y))then
autorise=1
i=obstaclenb+1
end
i=i+1
end
end
if autorise==0 then
local i=1
while i<=obstacle1nb do
--for i=1,obstacle1nb,1 do--wandrille le 1 correspond au nb de point de collison(obstacle1)----------------------------------------------------------------------------------------------------------------
if 20000>((self.x-obstacle1[i].x)*(self.x-obstacle1[i].x)+(self.y+30-obstacle1[i].y)*(self.y+30-obstacle1[i].y))then
autorise=1
i=obstacle1nb+1
end
i=i+1
end
end
if autorise==0 then
if obstacle0nb>=1 then
local i=1
while i<=obstacle0nb do
local rayon=500
if obstacle0[i].rayon~=nil then
rayon=obstacle0[i].rayon
end
if rayon>((self.x-obstacle0[i].x)*(self.x-obstacle0[i].x)+(self.y+30-obstacle0[i].y)*(self.y+30-obstacle0[i].y))then
autorise=1
i=obstacle0nb+1
end
i=i+1
end
end
end
else
local i=2
if not goh then
while i<=cheminnb+1 do
--for i=1, cheminnb+1,1 do
local rayonauto=2000
if chemin[i].rayon~=nil then
rayonauto=chemin[i].rayon
end
if rayonauto>((self.x-chemin[i].x)*(self.x-chemin[i].x)+(self.y-chemin[i].y)*(self.y-chemin[i].y))then
autorise=0
end
i=i+1
end
else
while i<=cheminnb+1 do
local coef=1
if chemin[i].mechant~=nil and not modepanique then
if chemin[i].mechant>1 or goh then
coef=chemin[i].mechant*chemin[i].mechant
end
end
if 400*coef*cheminlargeur>((self.x-chemin[i].x)*(self.x-chemin[i].x)+(self.y-chemin[i].y)*(self.y-chemin[i].y))then
autorise=0
end
i=i+1
end
end
end
end
if autorise==2 then
autorise=1
end
if autorise==0 then
local i=1
while i<=nbbatiment do
--for i=1,nbbatiment do//for remplacer par while
if ibatiment[i]~=nil then
if ibatiment[i].x1~=nil and ibatiment[i].y1~=nil and self.x~=nil and self.y~=nil then
if 1500>(self.x-ibatiment[i].x1)*(self.x-ibatiment[i].x1)+(self.y-ibatiment[i].y1)*(self.y-ibatiment[i].y1) then
autorise=1
i=nbbatiment+1
end
end
end
i=i+1
end
end
return autorise
end
if true then
local function drapeautap()--clic sur le drapeau de localisation du general
if fenaff==false and clicpause==0 then
if clicconstruire==0 then
if pv1clicactiver==1 then
Runtime:removeEventListener( "tap",clicpv1)
group[2048]:remove(pv1affinter)
pv1affinter:removeSelf()
pv1affinter=nil
pv1clicactiver=0
pvaction.isVisible=false
end
if pv2clicactiver==1 then
Runtime:removeEventListener( "tap",clicpv2)
pv2clicactiver=0
pvaction.isVisible=false
end
--priortié face au pouvoir 3 n'est pas faite!
drapeaugeneclic=1
local function drapeaugeneclic1( event )
drapeaugeneclic=0
end
drapeaugeneclic1=timer.performWithDelay( 50, drapeaugeneclic1 )
if boutondev==1 then
local batiment = require( "batiment" )
batiment.supbouton()
end
--print(321)
genepoint.x=drapeau1.x
genepoint.y=drapeau1.y
print("distancegene nouveau drap "..mathsqrt(((genepoint.x-isoldat[genenum].x1)^2+(genepoint.y-isoldat[genenum].y1)^2)))
if isoldat[genenum].vivant then
if mathsqrt(((genepoint.x-isoldat[genenum].x1)^2+(genepoint.y-isoldat[genenum].y1)^2))>60 then
if isoldat[genenum].encombat==1 then
isoldat[genenum].vivant=false
isoldat[genenum].endeplacement=1
end
end
end
-- local k=1
-- while k<=nbsoldat do
-- if isoldat[k].gene==1 then
-- if isoldat[k].encombat==1 then
-- isoldat[k].vivant=false
-- isoldat[k].endeplacement=1
-- end
-- k=nbsoldat+1
-- end
-- k=k+1
-- end
if genedrap~=nil then
group[genedrap.group]:remove(genedrap)
genedrap:removeSelf()
genedrap=nil
genetap=0
else
--print("bug genedrap")
end
end
end
if genedrap~=nil then
group[genedrap.group]:remove(genedrap)
genedrap:removeSelf()
genedrap=nil
genetap=0
end
end
generalenmov=false
local var,xori,yori,self
local self1={}
local selfori={}
function generalmove(event,self)--test de function
--print("dans la fonction")
if genetap==0 then
if "began" ==event.phase and not fenaff and not generalenmov then
print("began")
var=0
self1.x=self.x
self1.y=self.y
selfori.x=self.x
selfori.y=self.y
--display.currentStage:setFocus(event.target)
--display.getCurrentStage():setFocus(event.target)
--event.target.isFocus = true
--self=event.target
clicsurqqcfunc()
geneclic=1
local function geneclic1( event )
geneclic=0
end
if(enconst==1)then--corrige le probleme uniquement quand on clique pas en meme temps sur pouvoir et valider
removenbat()
end
geneclic1=timer.performWithDelay( 50,geneclic1 )
if fenaff==false and clicpause==0 and pv1clic==0 and pv2clic==0 and pv3clic==0 and clicconstruire==0 and clicinfanterie==0 and clicarcher==0 and clicpouvoir1==0 and clicpouvoir2==0 and clicpouvoir3==0 and pv2clicactiver==0 and pv1clicactiver==0 and boutondev==0 and drapeausolclic==0 then
generalenmov=true
var=0
self1.x=self.x
self1.y=self.y
-- xori=self1.x
-- yori=self1.y
end
if genedrap~=nil then
group[genedrap.group]:remove(genedrap)
genedrap:removeSelf()
genedrap=nil
genetap=0
end
elseif "moved" ==event.phase and not fenaff and generalenmov then
print("move "..event.x)
var=var+(event.x-event.xStart)^2+(event.x-event.yStart)^2
if var>=500 and genedrap==nil then
hideConstrucButton()
genedrap=display.newGroup()
genedrap.group=2048
group[genedrap.group]:insert(genedrap)
drapeau1=display.newImage(imbouton.batiment,9) --imbouton.drapeau,1)
--drapeau1=display.newImage("choniveau/niv1.png", genepoint.x,genepoint.y,true)
drapeau1.x=self1.x --event.x/taille-self.x
drapeau1.y=self1.y --event.y/taille-self.y
drapeau1.xScale=0.15
drapeau1.yScale=0.15
genedrap:insert(drapeau1)
--geneconfirm.num=event.target.num
genedrapold=display.newImage(imbouton.batiment,9) -- imbouton.drapeau,1)--display.newImage("choniveau/niv1.png", genepoint.x,genepoint.y,true)
genedrapold.x=genepoint.x
genedrapold.y=genepoint.y
genedrapold.xScale=0.15*apparence
genedrapold.yScale=0.15*apparence
genedrapold.alpha=0.5
genedrap:insert(genedrapold)
end
if genedrap~=nil then
self1.x =selfori.x+(event.x-event.xStart)/taille -- - self1.x --event.xStart
self1.y =selfori.y+(event.y-event.yStart)/taille -- - self1.y --event.yStart
local autorise=testautorisation(self1)
if autorise==0 then
drapeau1.x=self1.x
drapeau1.y=self1.y
else
compteuropt=compteuropt+1
if compteuropt>2 then
compteuropt=0
local xdirec=1
if drapeau1.x>self1.x then
xdirec=-1
end
local ydirec=1
if drapeau1.x>self1.y then
ydirec=-1
end
local distancemin=(self1.x-drapeau1.x)*(self1.x-drapeau1.x)+(self1.y-drapeau1.y)*(self1.y-drapeau1.y)
if distancemin>1000 then --1000
local limitex1carre=drapeau1.x+30*(-xdirec)
local limitex2carre=self1.x+30*(xdirec)
local limitey1carre=drapeau1.y+30*(-ydirec)
local limitey2carre=self1.y+30*(ydirec)
local ancienxvalide=drapeau1.x
local ancienyvalide=drapeau1.y
local testposbat={}
testposbat.x=drapeau1.x
testposbat.y=drapeau1.y
local i=limitex1carre
local varrandx=mathfloor(mathabs(limitex1carre-limitex2carre)*0.1)
if varrandx<1 then
varrandx=1
end
local varrandy=mathfloor(mathabs(limitey1carre-limitey2carre)*0.1)
if varrandy<1 then
varrandy=1
end
while i*xdirec<limitex2carre*(xdirec) do
testposbat.x=i
local j=limitey1carre
while j*ydirec<limitey2carre*(ydirec) do
testposbat.y=j
local autorise1=testautorisation(testposbat)
if autorise1==0 then
local distancemintest=(self1.x-testposbat.x)*(self1.x-testposbat.x)+(self1.y-testposbat.y)*(self1.y-testposbat.y)
if distancemin>distancemintest then
distancemin=distancemintest
ancienxvalide=testposbat.x
ancienyvalide=testposbat.y
end
end
j=j+varrandy*ydirec
end
i=i+varrandx*(xdirec)
end
drapeau1.x=ancienxvalide
drapeau1.y=ancienyvalide
end
end
end
end
elseif generalenmov then
generalenmov=false
--event.target.isFocus=false
--display.getCurrentStage:setFocus(nil)
if genedrap~=nil then --if var>500 then
drapeautap()
-- else
-- if genedrap~=nil then
-- group[genedrap.group]:remove(genedrap)
-- genedrap:removeSelf()
-- genedrap=nil
-- end
end
end
else
print("genetap"..genetap)
if genedrap~=nil then
group[genedrap.group]:remove(genedrap)
genedrap:removeSelf()
genedrap=nil
genetap=0
end
end
end
end
function genetaptest(event)
--function geneb:tap(event)--gestion de clic sur le general permettant de choisir la position du general
clicsurqqcfunc()
print("clic sur gene")
if fenaff==false then
geneclic=1
local function geneclic1( event )
geneclic=0
end
if(enconst==1)then--corrige le probleme uniquement quand on clique pas en meme temps sur pouvoir et valider
removenbat()
end
geneclic1=timer.performWithDelay( 50,geneclic1 )
--print("dans 1")
if fenaff==false and clicpause==0 and pv1clic==0 and pv2clic==0 and pv3clic==0 and clicconstruire==0 and clicinfanterie==0 and clicarcher==0 and clicpouvoir1==0 and clicpouvoir2==0 and clicpouvoir3==0 and pv2clicactiver==0 and pv1clicactiver==0 and boutondev==0 and drapeausolclic==0 then
--print("dans 2")
if genetap==0 then
local function genetap1( event )
genetap=1
end
genetap1=timer.performWithDelay( 50,genetap1 )
--print("yolooo")
genedrap=display.newGroup()
genedrap.group=2048
group[genedrap.group]:insert(genedrap)
drapeau1=display.newImage(imbouton.batiment,9) --imbouton.drapeau,1)
--drapeau1=display.newImage("choniveau/niv1.png", genepoint.x,genepoint.y,true)
drapeau1.x=genepoint.x
drapeau1.y=genepoint.y
if genepoint.x==nil then
genepoint.x=isoldat[genenum].x or isoldat[genenum].x1 or 0
end
if genepoint.y==nil then
genepoint.y=isoldat[genenum].y or isoldat[genenum].x1 or 0
end
drapeau=display.newRect(genepoint.x, genepoint.y, 45, 45 )
drapeau.alpha=0.01
drapeau.xScale=1/taille*apparence--pour que sur un tel ca soit plus facile de le deplacer.
drapeau.yScale=1/taille*apparence
drapeau1.xScale=0.15
drapeau1.yScale=0.15
genedrap:insert(drapeau1)
genedrap:insert(drapeau)
geneconfirm=display.newImage(imbouton.batiment,11) -- imbouton.valider,1)--display.newImage("bouton/valider.png",genepoint.x,genepoint.y)
geneconfirm.x=genepoint.x
geneconfirm.y=genepoint.y
geneconfirm.xScale=0.1*apparence
geneconfirm.yScale=0.1*apparence
geneconfirm.isVisible=false
geneconfirm.num=event.target.num
genedrap:insert(geneconfirm)
genedrapold=display.newImage(imbouton.batiment,9) -- imbouton.drapeau,1)--display.newImage("choniveau/niv1.png", genepoint.x,genepoint.y,true)
genedrapold.x=genepoint.x
genedrapold.y=genepoint.y
genedrapold.xScale=0.15*apparence
genedrapold.yScale=0.15*apparence
genedrapold.alpha=0.5
genedrap:insert(genedrapold)
local function drapeautap()--clic sur le drapeau de localisation du general
if fenaff==false and clicpause==0 and geneconfirm.isVisible==true and geneclic==0 then
if clicconstruire==0 then
if pv1clicactiver==1 then
Runtime:removeEventListener( "tap",clicpv1)
group[2048]:remove(pv1affinter)
pv1affinter:removeSelf()
pv1affinter=nil
pv1clicactiver=0
pvaction.isVisible=false
end
if pv2clicactiver==1 then
Runtime:removeEventListener( "tap",clicpv2)
pv2clicactiver=0
pvaction.isVisible=false
end
--priortié face au pouvoir 3 n'est pas faite!
drapeaugeneclic=1
local function drapeaugeneclic1( event )
drapeaugeneclic=0
end
drapeaugeneclic1=timer.performWithDelay( 50, drapeaugeneclic1 )
if boutondev==1 then
local batiment = require( "batiment" )
batiment.supbouton()
end
--print(321)
genepoint.x=drapeau1.x
genepoint.y=drapeau1.y
--print("distancegene nouveau drap "..mathsqrt(((genepoint.x-isoldat[genenum].x1)^2+(genepoint.y-isoldat[genenum].y1)^2)))
if isoldat[genenum].vivant then
genepoint.x=genepoint.x or isoldat[genenum].x1
genepoint.y=genepoint.y or isoldat[genenum].y1
if mathsqrt(((genepoint.x-isoldat[genenum].x1)^2+(genepoint.y-isoldat[genenum].y1)^2))>60 then
if isoldat[genenum].encombat==1 then
isoldat[genenum].vivant=false
isoldat[genenum].endeplacement=1
end
end
end
-- local k=1
-- while k<=nbsoldat do
-- if isoldat[k].gene==1 then
-- if isoldat[k].encombat==1 then
-- isoldat[k].vivant=false
-- isoldat[k].endeplacement=1
-- end
-- k=nbsoldat+1
-- end
-- k=k+1
-- end
if genedrap~=nil then
group[genedrap.group]:remove(genedrap)
genedrap:removeSelf()
genedrap=nil
genetap=0
else
--print("bug genedrap")
end
end
end
end
function drapeau:touch( event )--deplacement du drapeau
--print("1")
print("drapeau touch")
local result = true
local phase = event.phase
local previousTouches = self.previousTouches
local numTotalTouches = 1
if ( previousTouches ) then
-- add in total from previousTouches, subtract one if event is already in the array
numTotalTouches = numTotalTouches + self.numPreviousTouches
if previousTouches[event.id] then
numTotalTouches = numTotalTouches - 1
end
end
if "began" == phase then
retinf.nbaction=retinf.nbaction+1
-- Very first "began" event
if ( not self.isFocus ) then
-- Subsequent touch events will target button even if they are outside the contentBoundss of button
display.getCurrentStage():setFocus( self )
self.isFocus = true
--miko collect values for panning
self.myX = event.x/taille-self.x-- event.x/(taille^0.55)-self.x------------------------------------a modifier ici ou plus bas
self.myY = event.y/taille-self.y----------------probleme du a taille qui vaut 1 par defaut alors qu'il devrait valoir (?)
geneconfirm.isVisible=false
--Collision detection
previousTouches = {}
self.previousTouches = previousTouches
self.numPreviousTouches = 0
elseif ( not self.distance ) then
local dx,dy
-- initialize to distance between two touches
end
if not previousTouches[event.id] then
self.numPreviousTouches = self.numPreviousTouches + 1
end
previousTouches[event.id] = event
var=0
xori=self.x
yori=self.y
elseif self.isFocus then
if "moved" == phase then
if ( self.distance ) then
local dx,dy
else
--self.myx coordonnée de depart
var=var+(self.x-xori)^2+(self.y-yori)^2
self.x = event.x/taille - self.myX
self.y = event.y/taille - self.myY
--drapeau1.x=self.x
--drapeau1.y=self.y
local autorise=testautorisation(self)
-- local autorise=1
-- for i=1, cheminnb+1,1 do
-- if 2000>((self.x-chemin[i].x)^2+(self.y-chemin[i].y)^2)then
-- autorise=0
-- end
-- end
--self.x, self.y = x, y
if autorise==0 then
drapeau1.x=self.x
--if drapeau1.y~=self.y then
drapeau1.y=self.y
--group[drapeau1.pos]:remove( drapeau1 )
--drapeau1.pos=mathfloor(drapeau1.y)+1024
--group[drapeau1.pos]:insert( drapeau1 )
--end
else
compteuropt=compteuropt+1
if compteuropt>2 then
--print("compteur==30")
compteuropt=0
local xdirec=1
if drapeau1.x>self.x then
xdirec=-1
end
local ydirec=1
if drapeau1.x>self.y then
ydirec=-1
end
local distancemin=(self.x-drapeau1.x)*(self.x-drapeau1.x)+(self.y-drapeau1.y)*(self.y-drapeau1.y)
if distancemin>1000 then --1000
local limitex1carre=drapeau1.x+30*(-xdirec)
local limitex2carre=self.x+30*(xdirec)
local limitey1carre=drapeau1.y+30*(-ydirec)
local limitey2carre=self.y+30*(ydirec)
local ancienxvalide=drapeau1.x
local ancienyvalide=drapeau1.y
local testposbat={}
testposbat.x=drapeau1.x
testposbat.y=drapeau1.y
local i=limitex1carre
local varrandx=mathfloor(mathabs(limitex1carre-limitex2carre)*0.1)
if varrandx<10 then
varrandx=10
end
local varrandy=mathfloor(mathabs(limitey1carre-limitey2carre)*0.1)
if varrandy<10 then
varrandy=10
end
while i*xdirec<limitex2carre*(xdirec) do
testposbat.x=i
local j=limitey1carre
while j*ydirec<limitey2carre*(ydirec) do
testposbat.y=j
local autorise1=testautorisation(testposbat)
if autorise1==0 then
local distancemintest=(self.x-testposbat.x)*(self.x-testposbat.x)+(self.y-testposbat.y)*(self.y-testposbat.y)
if distancemin>distancemintest then
distancemin=distancemintest
ancienxvalide=testposbat.x
ancienyvalide=testposbat.y
--print("trouver meilleur position "..distancemin)
--print("x"..ancienxvalide.." y "..ancienyvalide)
end
end
j=j+varrandy*ydirec
end
i=i+varrandx*(xdirec)
--print("i="..i)
end
drapeau1.x=ancienxvalide
drapeau1.y=ancienyvalide
end
end
end
-- local ptx=1--point ou on a la dist min
-- local pty=1
-- local distxmin=(self.x-chemin[1].x)^2
-- local distymin=(self.y-chemin[1].y)^2
-- local disttt=(self.x-chemin[1].x)^2+(self.y-chemin[1].y)^2
-- local pttt=1
-- local calc=nil
end
if not previousTouches[event.id] then
self.numPreviousTouches = self.numPreviousTouches + 1
end
previousTouches[event.id] = event
elseif "ended" == phase or "cancelled" == phase then
if previousTouches[event.id] then
self.numPreviousTouches = self.numPreviousTouches - 1
previousTouches[event.id] = nil
end
if ( #previousTouches > 0 ) then
-- must be at least 2 touches remaining to pinch/zoom
self.distance = nil
else
-- previousTouches is empty so no more fingers are touching the screen
-- Allow touch events to be sent normally to the objects they "hit"
display.getCurrentStage():setFocus( nil )
self.isFocus = false
self.distance = nil
self.xScaleOriginal = nil
self.yScaleOriginal = nil
-- reset array
self.previousTouches = nil
self.numPreviousTouches = nil
end
self.x=drapeau1.x
self.y=drapeau1.y
geneconfirm.x=drapeau1.x
geneconfirm.y=drapeau1.y
geneconfirm.isVisible=true
--if var<80 then
drapeautap()
--end
end
end
return result
end
drapeau:addEventListener( "touch", drapeau )
function drapeau:tap(event)
clicsurqqcfunc()
drapeautap()
end
drapeau:addEventListener("tap",drapeau)
elseif genedrap~=nil then --ne fonctionne pas
group[genedrap.group]:remove(genedrap)
genedrap:removeSelf()
genedrap=nil
genetap=0
end
end
end
end
-- if contreaihaut==0 or contreai==1 then --and contreaihaut==1) then
-- --geneb:addEventListener( "tap", geneb )
-- print("contreaihaut 1")
-- else
-- print("contreaihaut 0")
-- end
end
return(t)