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 / Detecting if sprite has collision on feet only

Author
Message
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 25th Sep 2021 23:31
I need to set a solution up for a problem for animations.

if my player sprite is in the air his jump animation only plays, but when his feet are on something his animations change.

the problem is there is no checking for just collision for under the sprite.

or is there, I searched for hours.

anything is helpful.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 26th Sep 2021 01:48
if you're still using sprite physics (as in your other threads) you should let us know. responses will probably be based up whether you are or not.
[My Itch.io Home] [AGK on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 26th Sep 2021 02:18
Yes I am sorry

I am using sprite physics

I am making a side scroller for the first time, I have everything set perfect but my jump animation.
Loktofeit
AGK Developer
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 26th Sep 2021 11:08
Checking for collision by group might help.
LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 26th Sep 2021 11:31
Loktofeit

I need when the player sprite lands on the enemy sprite that sprite is deleted/

But when I even touch the sprite it deletes.

I need if the feet of the sprite or under the sprite collision detection.

PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 26th Sep 2021 14:46
You could add a shape to the player feet and one to the enemy head and set them to a group, or what I would do is simply cast some rays down from the player feet about 5 px and at the collision if any of the rays hits the enemy then you jumped on its head else you die


Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 26th Sep 2021 23:05


PartTimeCoder, Yes, I think that casting rays is a good idea, Ill try and see what happens.

Thanks for the idea.

Login to post a reply

Server time is: 2024-03-28 08:03:46
Your offset time is: 2024-03-28 08:03:46