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 / Get sprite in box full explanation

Author
Message
Game_Code_here
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 13th Jul 2020 18:00
Ok so I understand the process, but don't know how to draw the boxes as the explanation is not very explanatory.

I need to draw a box next to a sprites position. 4 different boxes, at the top of the sprite , on both sides and and the bottom so if the sprite goes up or down or left to right it gets box collision.

The problem is that I don't understand how the boxes are called for even with examples.
PSY
Valued Member
4
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 13th Jul 2020 18:09
GetSpriteInBox() is not what you're looking for.
This command checks whether or nor a sprite is within a rectangle.

Either use DrawBox() to draw boxes, or use sprites for the boxes.


PSY


PSY LABS Games
Coders don't die, they just gosub without return
Game_Code_here
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 13th Jul 2020 22:02
Okay, thanks for the heads up.
PSY
Valued Member
4
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 14th Jul 2020 00:41
No problem


PSY LABS Games
Coders don't die, they just gosub without return
PartTimeCoder
AGK Tool Maker
5
Years of Service
User Offline
Joined: 9th Mar 2015
Location: Suffolk UK
Posted: 3rd Aug 2020 09:38
Coming from a WinAPI background I find it easier to use POINT and RECT structures for such things, just my way of coding

heres a few helper functions for using such structures in AGK



Login to post a reply

Server time is: 2020-09-27 21:44:25
Your offset time is: 2020-09-27 21:44:25