ZFG Posted January 2, 2009 Report Share Posted January 2, 2009 Is there a way to make Sonic Balance like this: I'm using Damizean's 360 engine from the site. I have tried this: //Edge Wobling if (hsp = 0 && collision_sensor_right_line( x, y, angle, obj_walls ) == true ) { animation=19; } if (hsp = 0 && collision_sensor_left_line( x, y, angle, obj_walls ) == true ) { animation=19; } But this makes him play the Animation even though he is not close the an edge. Link to comment Share on other sites More sharing options...
Sponick Posted January 2, 2009 Report Share Posted January 2, 2009 I succed at doing this by creating two simple scripts that checks two points. scrRightPoint: if collision_point(x+3,y+20,obj_walls,true,false) return true;else return false;[/CODE]scrLeftPoint:[CODE]if collision_point(x+3,y+20,obj_walls,true,false) return true;else return false;[/CODE]Then, at draw event, first piece of code, after idle animation code, write this:[CODE]if (hsp==0 && ground && action==0 && !scrRightPoint() && scrLeftPoint()) { **Edge wobling animation code**}[/CODE]And now, the same but for the other direction (RightPoint && !LeftPoint);Anf of course, add the layers to the scripts ^^Hope this works in your engine. Link to comment Share on other sites More sharing options...
ZFG Posted January 2, 2009 Author Report Share Posted January 2, 2009 Well, this makes Sonic invincable. Link to comment Share on other sites More sharing options...
cyborg_ar Posted January 2, 2009 Report Share Posted January 2, 2009 there was a thread...... here: http://www.sonicfangameshq.com/forum/showthread.php?t=3497 hope that helps Link to comment Share on other sites More sharing options...
Kain Posted January 2, 2009 Report Share Posted January 2, 2009 Sonic Edge Wobbles happen when he's on the edge, thus you're looking for a lack of collision. if (hsp == 0 && collision_sensor_right_line( x, y, angle, obj_walls ) == false && ground == true) { animation=19; } if (hsp == 0 && collision_sensor_left_line( x, y, angle, obj_walls ) == false && ground == true) { animation=19; } Or you could try Sponick's method and put it in the End Step event (or really anywhere in a step event) rather than the Draw event. The reason Sonic disappears (I'm guessing) is because you use the default drawing functionality, and putting code in the Draw event disables that functionality. Link to comment Share on other sites More sharing options...
Sponick Posted January 2, 2009 Report Share Posted January 2, 2009 First of all, I don't understand wtf means invincable xD Anyways, don't understand what's the problem you have. I tried it and works well for me... Link to comment Share on other sites More sharing options...
Recommended Posts