ping 15 instead of 9 points

This commit is contained in:
Octopus Octopus 2024-03-17 14:53:20 -05:00
parent e5a30e6e40
commit 1f4f097f35
2 changed files with 13 additions and 1 deletions

View File

@ -20,23 +20,35 @@ func (b bubbles) draw(x int, y int) *gg.Context {
// the nature of pinging for points is that you can always end up with something // the nature of pinging for points is that you can always end up with something
// in between points if one is sufficently large and the other is sufficently small. // in between points if one is sufficently large and the other is sufficently small.
px, py = rand.Intn(x-i.SizeX)+i.SizeX/2, rand.Intn(y-i.SizeY)+i.SizeY/2 px, py = rand.Intn(x-i.SizeX)+i.SizeX/2, rand.Intn(y-i.SizeY)+i.SizeY/2
switch { // ping 9 points to verify if an different bubble is beneath this one. switch { // ping 15 points to verify if an different bubble is beneath this one.
case !isTransparent(dc.Image(), px-i.SizeX/2, py-i.SizeY/2): //top left case !isTransparent(dc.Image(), px-i.SizeX/2, py-i.SizeY/2): //top left
noCollision = false noCollision = false
case !isTransparent(dc.Image(), px-i.SizeX/4, py-i.SizeY/4): //top 2/5th
noCollision = false
case !isTransparent(dc.Image(), px, py-i.SizeY/2): // top case !isTransparent(dc.Image(), px, py-i.SizeY/2): // top
noCollision = false noCollision = false
case !isTransparent(dc.Image(), px+i.SizeX/4, py-i.SizeY/2): //top 4/5th
noCollision = false
case !isTransparent(dc.Image(), px+i.SizeX/2, py-i.SizeY/2): //top right case !isTransparent(dc.Image(), px+i.SizeX/2, py-i.SizeY/2): //top right
noCollision = false noCollision = false
case !isTransparent(dc.Image(), px-i.SizeX/2, py): //center left case !isTransparent(dc.Image(), px-i.SizeX/2, py): //center left
noCollision = false noCollision = false
case !isTransparent(dc.Image(), px-i.SizeX/4, py): //center 2/5th
noCollision = false
case !isTransparent(dc.Image(), px, py): //center case !isTransparent(dc.Image(), px, py): //center
noCollision = false noCollision = false
case !isTransparent(dc.Image(), px+i.SizeX/4, py): //center 4/5th
noCollision = false
case !isTransparent(dc.Image(), px+i.SizeX/2, py): //center right case !isTransparent(dc.Image(), px+i.SizeX/2, py): //center right
noCollision = false noCollision = false
case !isTransparent(dc.Image(), px-i.SizeX/2, py+i.SizeY/2): //bottom left case !isTransparent(dc.Image(), px-i.SizeX/2, py+i.SizeY/2): //bottom left
noCollision = false noCollision = false
case !isTransparent(dc.Image(), px-i.SizeX/4, py+i.SizeY/2): //bottom 2/5th
noCollision = false
case !isTransparent(dc.Image(), px, py+i.SizeY/2): //bottom case !isTransparent(dc.Image(), px, py+i.SizeY/2): //bottom
noCollision = false noCollision = false
case !isTransparent(dc.Image(), px+i.SizeX/4, py+i.SizeY/2): //bottom 4/5th
noCollision = false
case !isTransparent(dc.Image(), px+i.SizeX/2, py+i.SizeY/2): //bottom right case !isTransparent(dc.Image(), px+i.SizeX/2, py+i.SizeY/2): //bottom right
noCollision = false noCollision = false
default: default:

BIN
map

Binary file not shown.