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?

Author
Message
hoyoyo80
7
Years of Service
User Offline
Joined: 11th May 2016
Location:
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.

Thanks
smallg
Valued Member
18
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
hoyoyo80
7
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 28th Sep 2017 00:16
Thanks for the reply/.

Let say i have:

type sprite

sprimg
xvalues

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?

Thanks.

Login to post a reply

Server time is: 2024-04-19 06:51:38
Your offset time is: 2024-04-19 06:51:38