Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Detect collision between two immobile sprites?

Author
Message
JLM
9
Years of Service
User Offline
Joined: 21st Jul 2015
Location:
Posted: 16th Oct 2015 02:29
I'm scaling a sprite and want any sprite it touches to delete, but it seems collisions don't fire when contact is made without moving the x,y position of either sprite, unless I'm missing something...

Basically I have lots of sprites scattered around, I spawn an explosion sprite and it scales larger. I want anything that second sprite touches to delete. Any ideas?

Code: (Sprite[spritenum] is a randomly generated sprite, sprite(4) is the scaling sprite)
-Writing programs for years, new to AGK2
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 16th Oct 2015 09:17
Maybe try resetting the sprite shape after changing its scale - SetSpriteShape()...
Using AppGameKit V2 Tier 1
lilpissywilly
AGK Developer
14
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 16th Oct 2015 14:01 Edited at: 16th Oct 2015 14:02
I assume "spritenum" is in a For or While loop (and increased manually) ?

If you can't figure it out using GetSpriteCollision you could use GetSpriteInCircle or GetSpriteInBox and use the size and location of the explosion sprite
My hovercraft is full of eels

Login to post a reply

Server time is: 2024-11-16 22:07:35
Your offset time is: 2024-11-16 22:07:35