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 / Raycasting on sprite types and change its field values?

Years of Service
User Offline
Joined: 11th May 2016
Posted: 26th Sep 2017 08:35
Hi all...

Im doing something like this:

1. Creating array of custom type,give them sprite image, id and its values
2.Using raycast to check which of the type had been hit and alter it values.

So, my question. Currently upon raycast, i iterate through all the type. Is there any way i can just get which type had been hit and altered its field value? Without iterating i mean.

Valued Member
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 27th Sep 2017 18:28
you can use SpriteRayCastGroup( group, x, y, x2, y2 ) or SpriteRayCastCategory( category, x, y, x2, y2 )
and then
spritehit = GetRayCastSpriteID( )
or is this not what you mean?
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
Years of Service
User Offline
Joined: 11th May 2016
Posted: 28th Sep 2017 00:16
Thanks for the reply/.

Let say i have:

type sprite


end type

and then make dim colorspr[100] as sprite

Is it possible it do, if raycastsingle(colorspr group) and directly change it xvalues(for that specific sprite) without iterating the 100 which of the sprite had been hit?


Login to post a reply

Server time is: 2020-04-05 19:32:45
Your offset time is: 2020-04-05 19:32:45