Slow_Motion Posted August 3, 2009 Report Share Posted August 3, 2009 Im using Full engine some one posted...if im not mistaken its sonic fgx. Here is my code in collision with the terrain / wall parrent KEY_A= keyboard_check_pressed(ord('Z'))KEY_RIGHT= keyboard_check_pressed(vk_right)KEY_LEFT= keyboard_check_pressed(vk_left)if KEY_LEFT or KEY_RIGHT && KEY_A && !ground{wallj=1}else{exit;}if wallj=1{action=16}else{exit;}if action==16 && KEY_A && xdir=1{hsp=xdir+5 vsp=xdir+5}if action=16 && KEY_A && xdir=-1{hsp=xdir-5 vsp=xdir-5}[/CODE]My problem is it dosnt do anything. here is a lil something extra in step event,[CODE]if ground{wallj=false}[/CODE]the "ground" var means if he is standing on ground not touching an object. I put this in create..not sure if this matters[CODE]wallj=0[/CODE]Also, how do i make it where it checks if its walljumping before air attack/ homing attack, if that is my problem. here is my homing / air attack code,[CODE]//Homing attack (check animations for drawing sprites) if action=1 or action=7 { if KEY_A && delay=0 { action=5 //Play homing sound below action=5 if instance_number(enemy_basic)>0 && distance_to_object(enemy_basic) <150 //Check if there are enemies first { if distance_to_object(enemy_basic)<150 && enemy.y>=y //Locked on (enemy must be in-line or below Sonic, not above) {lock=1} else {vsp=0 hsp+=xdir*6 lock=0} //If not near an enemy, just go foward } else {vsp=0 hsp+=xdir*6 lock=0} //If there are no enemies, just go foward } } //Lock on to nearest enemy (Notice I switch from Damizean's hsp,vsp function to speed and direction then back) if instance_number(enemy_basic)>0 { if lock=1 && distance_to_object(enemy_basic)<150 //Go towards enemy {direction=point_direction(x,y,enemy.x,enemy.y) speed=12 hsp=0 vsp=0} else if lock=1 && speed>0 //Cancel lock (too far away from enemies) {lock=0 hsp=hspeed vsp=vspeed speed=0} } else if lock=1 && speed>0 //Cancel lock (If no enemies are present) {lock=0 hsp=hspeed vsp=vspeed speed=0} //If there is a wall between you and an enemy, stop homing attack (also applies to layers) if instance_number(enemy_basic)>0 { if collision_line(x,y,enemy.x,enemy.y,obj_walls,1,1) && lock=1 {vsp=0 hsp+=xdir*6 lock=0 speed=0} else if collision_line(x,y,enemy.x,enemy.y,obj_hlayer,1,1) && lock=1 && layer=0 {vsp=0 hsp+=xdir*6 lock=0 speed=0} else if collision_line(x,y,enemy.x,enemy.y,obj_llayer,1,1) && lock=1 && layer=1 {vsp=0 hsp+=xdir*6 lock=0 speed=0} }[/CODE] I dont have an animation code for wall jumping...its not important right now.Problem:it wont walljump.Im using Gamemaker 7.0 ProI cant for the life of my remember the name of the engine but it has parts of sonic revival...that I added. Link to comment Share on other sites More sharing options...
Slow_Motion Posted August 8, 2009 Author Report Share Posted August 8, 2009 Bump..help me. Link to comment Share on other sites More sharing options...
Realm0D Posted August 8, 2009 Report Share Posted August 8, 2009 Bump..help me. Most users here use MMF2, TGF2, C++ or 3D programs. I think you'd have a better chance of help with ur problems at : http://gmc.yoyogames.com/ Link to comment Share on other sites More sharing options...
Asuma Posted August 9, 2009 Report Share Posted August 9, 2009 There's quite a few of use who uses GM. We even have a GM section on the main site. However, most of them uses Damizean/RougeYoshi's engine. Link to comment Share on other sites More sharing options...
Kain Posted August 15, 2009 Report Share Posted August 15, 2009 Here is my code in collision with the terrain / wall parrent Most engines are designed in a "get-out-of-the-wall" kind of way (as opposed to a "stick-to-the-wall" kinda way) such that collision with the terrain are minimal and extremely brief. There's a high probability that the collision with terrain/wall parent event literally never happens. What you should do is put all this in the Step event inside an if statement which checks for collision with a slightly bigger mask than the collision detection uses (the easiest way to do this is using the function "collision_rectangle"). 1 Link to comment Share on other sites More sharing options...
Recommended Posts