Re: bgt, I nead a litil help
Re: bgt, I nead a litil help Well it should restart the timer because I told it in the code to do so URL: https://forum.audiogames.net/post/516581/#p516581 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt, I nead a litil help
Re: bgt, I nead a litil help If they freak out, chances are you are not restarting their timer. You should do so regardless of them moving. URL: https://forum.audiogames.net/post/516520/#p516520 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt, I nead a litil help
Re: bgt, I nead a litil help ok, so I just saw that, they will start freak out and freaz the game because of tuns of movement at only 1 tile is when they reach there destenation which is randxdoes that makes sense somehow? URL: https://forum.audiogames.net/post/516487/#p516487 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt, I nead a litil help
Re: bgt, I nead a litil help well what i did when incountering this problom is kinda simeller I made a timer which when reach 5 sekinds, it will change randx to a random plase around the map, forsing helpers[i] to go to it, making in infenit loop URL: https://forum.audiogames.net/post/516450/#p516450 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt, I nead a litil help
Re: bgt, I nead a litil help If you want that, do something similar toif (walk_timer.elapsed >= 500) {walk_timer.restart();int direction = random(1, 4);// depending on the number it generates it moves in a different direction, just basic if statements// code for walls and things, herehth URL: https://forum.audiogames.net/post/516443/#p516443 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt, I nead a litil help
Re: bgt, I nead a litil help oh yeah and I wanted them to walk freely around the map, not pitrole a small area URL: https://forum.audiogames.net/post/516433/#p516433 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt, I nead a litil help
Re: bgt, I nead a litil help well my problom is not with the spead, also, I have completely no idea about those lines you sedx+=sin(angle*pi/180);y+=cos(angle*pi/180);is this eavin bgt? sorry but i'm stupid but I dont there are in the chm file, could you explane a litil a litil bit more URL: https://forum.audiogames.net/post/516422/#p516422 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt, I nead a litil help
2020-04-05
Thread
AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector
Re: bgt, I nead a litil help Hi there,well, I guess you wanted to set them a path, on which they would patrol from one end to another and back didn't you?It's quite logical that they freeze on one point. They have a x coordinate for example, which you're increasing by 1 until it crosses randx.Then it jumps to the second condition, which decreases the x coordinate in case that it's further than randx.But just think, by doing so, you again end up on randx, thus the condition:if (helpers[i].x<=randx)is true again and the x coordinate will increase. Second condition:if (helpers[i].x>=randx)activates, decreasing x by 1, ending up on randx, activating the first condition and that goes in a loop for ever and ever.You need to take a completely different approach, for example using:x+=sin(angle*pi/180);y+=cos(angle*pi/180);Where angle will be some randomly or semyrandomly set angle, which your characters will follow until hitting patrolling borders.You can use orthogonal movement as well of course, but you still need some way of controlling direction to avoid the stucking problem you face right now.As for the speed, that depends on the code, which is responsible for calling the movement method, you didn't include it here, so it's not possible to tell, where exactly the problem is.Best regardsRastislav URL: https://forum.audiogames.net/post/516421/#p516421 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt, I nead a litil help
Re: bgt, I nead a litil help oh yeah and its not a timer problom, I set it so if a timer reach 500, it calls twalk() URL: https://forum.audiogames.net/post/516333/#p516333 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector