I did my research here, and this is what im asking for help with. I want to program the custom collsion detection, not to the extent of a bunch of polygons, but take this example and then look at my psueado code below:
The player is walking and hits a force field in the shape of a star, using WED blocks, i could put an invisible block there or, using C-Script I could program the collsion detection. However, i don't want to edit any of my levels, and want all of the effects to be script driven.
Ok, you can basically make collsion detection in levels by using invisible blocks, or you could use something like this:
IF ((player.X > collison_point_min.X) && (player.X < collsion_point_max.X)) {
IF ((player.Y> collison_point_min.Y) && (player.Y < collsion_point_max.Y)) {
// here we would block the player from going any further.
}
}
While this would in theroy work for straight lines that are at 90* angles with other lines, or rectangles, what about coding a collsion detection for a triangular area. My thoughts on this use something like vec_subtract(collsion_point_min.X,collsion_point_max.X) and checking if the player was in that area. But, i have no clue as what the actual coding would look like. I'll continue to look up and try stuff from the manual, and if i figure it out, i'll post it here, for the time being if anyone has any clues as to how i could do this, please without any code i would greatly appreciate it. I gotta figure this out myself.
If you need a better description on this subject let me know.
-NI