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 / i can not keep the shape of my collision

Author
Message
Raizzan
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location:
Posted: 23rd Dec 2015 16:54 Edited at: 23rd Dec 2015 17:24
hi there!
guys..im getting crazy please help!
im trying to give my characters a special selfmade collision-shape
but they loose the shape.





what the hell im doing wrong?
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 23rd Dec 2015 17:19
have you assigned a value to sprIDcharacter, imgIDcollision, etc.? It may be that you intend to do this:
imgIDcollision = LoadImage("collisionbox.png") etc.
This automatically assigns a value to imgIDcollision, whereas the method you have used expects a value to have already been assigned to imgIDcollision.

If you haven't set values to your ID variables, then you will be setting the sprite shape to that of hero.png (because it will be image# 0).



V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Raizzan
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location:
Posted: 23rd Dec 2015 17:37

Heyyy thanks for the quick response!
Well, yes, of course i did, otherwise a lot of things wouldnt work.


i found an unconvenient way to fix this issue - though its pretty nasty:



it works .
But now i have an ugly 11th frame i dont like :/

well.... i think thats a bug in agk2.
you know:
SetSpriteImage ( iSpriteIndex, iImageIndex, bUpdateShape )
if bUpdateShape = 0 and bUpdateShape = 1 doesnt matter = its the same = makes no difference

or has anyone else experienced a working "bUpdateShape " ??

from the SetSpriteImage documentation:
bUpdateShape - Sets whether the collision shape of this sprite should be changed to match the new image. ( 1 or 0 )
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 24th Dec 2015 09:40
Could be worth setting the shape manually with SetSpriteShapePolygon, or maybe use an app to help such as RUBE or Bax's ShapeUp.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign

Login to post a reply

Server time is: 2024-09-29 09:18:41
Your offset time is: 2024-09-29 09:18:41