Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///dash collision
- radians = direction*pi/180;
- for (i = 1; i < dashspeed; i +=1) {
- dx = cos(radians);
- dy = -sin(radians);
- dx *= i; //distance to check
- dy *= i;//distance to check
- if (!collision_point(x+dx,y+dy,tile,false,true)) {
- if (direction = 90 and (collision_point(x+dx,y+dy-1,tile,false,true))) {
- dashspeed = 0;
- }
- else if (direction = 180 and (collision_point(x+dx-1,y+dy,tile,false,true))){
- dashspeed = 0;
- }
- else if (direction = 270 and (collision_point(x+dx,y+dy+1,tile,false,true))){
- dashspeed = 0;
- }
- else if (direction = 0 and (collision_point(x+dx+1,y+dy,tile,false,true))){
- dashspeed = 0;
- }
- else if (direction = 45 and (collision_point(x+dx,y+dy-1,tile,false,true))){
- direction = 0;
- }
- else if (direction = 45 and (collision_point(x+dx+1,y+dy,tile,false,true))){
- direction = 90;
- }
- else if (direction = 135 and (collision_point(x+dx-1,y+dy,tile,false,true))){
- direction = 90;
- }
- else if (direction = 135 and (collision_point(x+dx,y+dy-1,tile,false,true))){
- direction = 180;
- }
- else if (direction = 225 and (collision_point(x+dx,y+dy+1,tile,false,true))){
- direction = 180;
- }
- else if (direction = 225 and (collision_point(x+dx-1,y+dy,tile,false,true))){
- direction = 270;
- }
- else if (direction = 315 and (collision_point(x+dx+1,y+dy,tile,false,true))){
- direction = 270;
- }
- else if (direction = 315 and (collision_point(x+dx,y+dy+1,tile,false,true))){
- direction = 0;
- }
- }
- else{
- }
- }
- x+=dx;
- y+=dy;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement