Quantcast
Channel: Active questions tagged game-maker - Stack Overflow
Viewing all articles
Browse latest Browse all 180

Can someone please explain how to alternate between three points

$
0
0

I am tring to make it where you have the camera move between 3 points when you change the current state of where you are looking at (left, middle, and right).

what I tried is to create a seperate object which can move between these 3 point and so the camera follows it to that location, the problem is that it doesn't go to the middle location (moves right past it) and when it reaches the right location, it keeps on glitching back and forth.

any help is needed, thanks.

//create eventplaces = [60, 1024, 1989];b = 1;//step eventif (keyboard_check(vk_left)) {    if (b != 0) {        b--;    }}if (keyboard_check(vk_right)) {    if (b != 2) {        b++;    }}if (x != places[b]){    x += (20) * sign(places[b] - x);}

Tried having the middle point be set at a range of values rather than the specific endpoint, but at that point it just wont move at all.

also tried making it where the values are 0, room_width / 2, and room_width for left, middle and right respectively, but that didn't solve anything.

My theory is that it is because of the room itself? But that's just an estimation.

Will update if anything new happens.


Viewing all articles
Browse latest Browse all 180

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>