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.

Newcomers AppGameKit Corner / How to make hit box for sprite sheets

Author
Message
XTommy
4
Years of Service
User Offline
Joined: 8th Apr 2020
Location:
Posted: 15th Mar 2021 08:31
Hey , I want to make a small game ,I’m wondering how to make hit box for a sprite sheets. For example ,in the first frame, the hit box is small ,and in the second frame the hit box is bigger ,etc .thanks .
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 21st Apr 2021 20:06
You could have an invisible sprite of each hit box size and just swap the positions of the hit box sprites where one is safely out of the way and the other is where you want to check for collision. If the box doesn't rotate, you could use GetSpriteInBox() and just change the size when checking.
13/0
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 28th Apr 2021 06:17
i expect you will have to check for the current frame and change the hitbox accordingly, somehow. IE:

[My Itch.io Home] [Now Playing]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]

Login to post a reply

Server time is: 2024-11-23 09:33:27
Your offset time is: 2024-11-23 09:33:27