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 Studio Chat / TopDown Template - With correct collision detection. Uses the Scene Manager again as the Map Editor.

Author
Message
Amon
9
Years of Service
User Offline
Joined: 30th May 2014
Location: Shropshire, United Kingdom
Posted: 9th Apr 2019 04:28 Edited at: 9th Apr 2019 04:32
This topdown template has correct collision. left/right up/down diagonal collision is all handled by a rectsoverlap function and a little bit of math to ensure collision works properly and that the player stops when hitting a wall. The archive, compresssed with 7zip into a zip archive contains the exe also so you can quickly test it. Screenie below.

Have fun.

[edit] Code Below for main.agc



Win 10 Pro - AMD RYZEN 7 Octacore 3.8ghz - 32GB DDR4 - RTX 2070 8GB

Attachments

Login to view attachments
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 9th Apr 2019 05:11
Thanks for Sharing @Imagination Engineer
Bored of the Rings
User Banned
Posted: 9th Apr 2019 06:23
@IE-thanks for this...you're on a roll with all these templates...
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
Jeku
Moderator
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 11th Apr 2019 14:06
This is awesome, thanks!
nickydemon
8
Years of Service
User Offline
Joined: 19th May 2015
Location:
Posted: 11th Apr 2019 14:43
Hi there, thank you for your template. Tried it and it's nice!!
I have a question here, if I expand the map bigger, will it affect the performance for checking the game_wall.length?
I want to create a platformer that have tile collision.
Amon
9
Years of Service
User Offline
Joined: 30th May 2014
Location: Shropshire, United Kingdom
Posted: 11th Apr 2019 14:49 Edited at: 11th Apr 2019 14:50
Yes, there will be a performance hit, depending on what you are doing. It should be a trivial process to only check for collisions within a given area only. I'll see if I can come up with something.

As for how much of a performance hit there will be, I don't know. Best way to find out is to start making your game and test it.



If you need help with platform collisions look here.
https://forum.thegamecreators.com/thread/224207
Win 10 Pro - AMD RYZEN 7 Octacore 3.8ghz - 32GB DDR4 - RTX 2070 8GB

Login to post a reply

Server time is: 2024-03-29 15:17:53
Your offset time is: 2024-03-29 15:17:53