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 / How do I make colors respond to colors

Author
Message
En929
7
Years of Service
User Offline
Joined: 8th Feb 2017
Location:
Posted: 12th Apr 2021 03:55 Edited at: 12th Apr 2021 05:11
I'm trying to make a game where if my red character touches any green color anywhere in the game, the game ends. Thus, how do I make it so that colors respond to other colors in my game? Is there are color detection command?
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 12th Apr 2021 11:27
You could try this grand hack:
how to know the color of a point
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 12th Apr 2021 19:09 Edited at: 12th Apr 2021 19:10
AGK has no concept of what a red and green sprite are, you need to define it and use one of many functions designed for contact/collision checking

Look at: GetSpriteInBox()

or use collision checking functions (see help file)

or use something like this


there are many ways to know when a sprite touches another sprite, using colors/memblocks is advanced stuff and have zero benefit over using native functions.

Login to post a reply

Server time is: 2024-04-25 00:59:02
Your offset time is: 2024-04-25 00:59:02