Report as inappropriate.

Kirito101 presents ...

2014/10/1

# Shining_Force

fixed collision

1975 views / 322 in the last 7 days

1 vote | 0 in the last 7 days

Tags: with-source

Your browser does not support the canvas tag.
A new version of this scenario was uploaded on Wed Oct 01 17:39:42 UTC 2014
A new version of this scenario was uploaded on Thu Oct 02 16:48:24 UTC 2014
A new version of this scenario was uploaded on Fri Oct 03 14:28:07 UTC 2014
A new version of this scenario was uploaded on Fri Oct 03 14:57:45 UTC 2014 struggling to get the characters to move correctly when colliding. q and e to switch characters
11770

2014/10/3

if you dont mind my asking, how did you make it so they couldn't cross the river? i'm new and just couldnt find it in the file :/ i love this game btw :?
Kirito101

2014/10/10

This senses if the character is within 24 pixels of the center of river when facing a direction. If facing to the right it will only block going right. RiverA is my image.Hope this makes sense. There is no doubt a better way of doing this though. I used: public int Direction() { Actor RiverR=getOneObjectAtOffset(24,0,RiverA.class); Actor RiverL=getOneObjectAtOffset(-24,0,RiverA.class); Actor RiverT=getOneObjectAtOffset(0,-25,RiverA.class); Actor RiverB=getOneObjectAtOffset(0,25,RiverA.class); if(Greenfoot.isKeyDown("Up")) { Direction=3; if(RiverT == null) if(speed<=3) speed++; else{ speed=0;setLocation(getX(), getY()-1);} } else if(Greenfoot.isKeyDown("Right")) { Direction=4;//facing right //loop to move 1 square if(RiverR == null) if(speed<=3) speed++; else{ speed=0;move(1);} } else if(Greenfoot.isKeyDown("Left")) { Direction=2; if(RiverL == null) if(speed<=3) speed++; else{ speed=0;move(-1);} } else if(Greenfoot.isKeyDown("Down")) { Direction=1; if(RiverB == null) if(speed<=3) speed++; else{ speed=0;setLocation(getX(), getY()+1);} } return Direction; }