phoboslab / Impact

HTML5 Game Engine
MIT License
1.99k stars 204 forks source link

Collision Question #75

Closed yarnottc7892 closed 4 years ago

yarnottc7892 commented 4 years ago

I am fairly new to impact and I am having trouble getting collision to work properly. I looked through the forums and couldn't find the thing I was looking for. My problem is that I defined my level with a collision layer and now when I try to stay within the bound of the map I only collide with the top wall. In other words, collision is only occurring when I move the character in an upward direction. To me it seems like the collision box is too small or not working properly. Like I said I am still fairly new to Impact and any advice would be appreciated.

Joncom commented 4 years ago

Can you share the code showing how you are setting up your collision map? And also the code showing how you’re getting your entity to move around?

yarnottc7892 commented 4 years ago

I Figured it out. I was misspelling a variable name Y instead of y and the made some my player's collision box was non-existent,

Joncom commented 4 years ago

Glad you figured it out :)

yarnottc7892 commented 4 years ago

I have another question about Collision. So I am trying to do a trigger and I can't get the check function to work. On either of my objects, is there something I have to so to enable that? I am really confused on why it is not working. I followed the weltmeister guide on triggers and it is not working. I am attaching my trigger and player .js file. Any help is appreciated.

Trigger Code: TriggerCode

Player Code: PlayerCode