hi i amlearning touseprocessingneed to doapacman-like game, whereIpaintthefoodat random,I have notlearnedlessonsor anything,notifthefoodin this wayIpaintrandomlyvarying thetypes offoodandIget an errorcalled"arrayindexoutofboundexception:#" where #isthevaluewegivetofix mycode:
inttypes[]=newint[1]; voidsetup (){ for(inti=0;i<posesX.length;i++){ posesX[i]=(int)random(-200, 200); posesY[i]=(int)random(-100, 200); types[i]=(int)random(2);<----****** this is wrong }
voiddraw (){ for(inti=0;i<posesX.length;i++){ pintarComida(posesX[i],posesY[i],types[i]);(not if Iwork.)************ }