Jump to content


PhYs1aTr1sT

Member Since 22 Dec 2009
Offline Last Active Jul 01 2012 05:23 PM

Posts I've Made

In Topic: Hspeed Help

08 June 2010 - 09:31 AM

read the rules before bumping... and yes, if you use hspeed=-3, it would go left, hspeed=3 for right.

In Topic: 3d Help

07 June 2010 - 09:20 AM

its not pretty hard if you search for one. anyways, i found one by fede-lasee which is pretty good.
//block create event

//check the left, right, top, and bottom of the bounding box to see if there is any neighboring block there.
//if there is, disable that side. if there isn't, keep it active to prevent player from getting through.
topEnabled = (collision_point(bbox_left + 1, bbox_top - 1, objBlock, false, true) == noone);
bottomEnabled = (collision_point(bbox_left + 1, bbox_bottom + 1, objBlock, false, true) == noone);
leftEnabled = (collision_point(bbox_left - 1, bbox_top + 1, objBlock, false, true) == noone);
rightEnabled = (collision_point(bbox_right + 1, bbox_top + 1, objBlock, false, true) == noone);
//this is a loop that checks the collision of any of the colliding block's sides.
//first, it checks if the top side is enabled (see obj_block). if it is, check if
//the character is colliding at ANY point of that side. if it is, move the character
//away until it doesn't collide anymore. the same is done to the other three sides.

//collision with block event

//the number of times this is repeated is based on the maximum speed. it is done
//by multiplying playerSpeedMax with 40, since the amount of pixels it moves away
//from the block is 0.25. it's 40 and not 4 is because we want to make sure it doesn't
//move away SLOWLY.
var _repeatTimes, i;
_repeatTimes = SPEED * 40;
for (i = 0; place_meeting(x, y, other.id) && i < _repeatTimes; i += 1) {
  //check side...
  if (other.bottomEnabled) {
	//does it collide anywhere on that side?
	if (collision_line(other.bbox_left, other.bbox_bottom, other.bbox_right, other.bbox_bottom, id, true, false) != noone) {
	  //move the character up (away) because this is the top side
	  y += 0.25;
	}
  }
  if (other.topEnabled) {
	if (collision_line(other.bbox_left, other.bbox_top, other.bbox_right, other.bbox_top, id, true, false) != noone) {
	  y -= 0.25;
	}
  }
  if (other.rightEnabled) {
	if (collision_line(other.bbox_right, other.bbox_top, other.bbox_right, other.bbox_bottom, id, true, false) != noone) {
	  x += 0.25;
	}
  }
  if (other.leftEnabled) {
	if (collision_line(other.bbox_left, other.bbox_top, other.bbox_left, other.bbox_bottom, id, true, false) != noone) {
	  x -= 0.25;
	}
  }
}
credits go to fede-lasse if used

In Topic: Help With Melee Ai

04 June 2010 - 06:06 AM

do you have the code or do you want us to give you the code? anyways, i dont understand the shooting animation part though o.0

In Topic: Sprite Rotating

02 June 2010 - 11:23 AM

use this tutorial for the shooting at the gun tip if thats what you mean. it really helps
tut

In Topic: Arrow Facing Mouse....

01 June 2010 - 11:23 PM

Alright, i've created 360 frames, each 1 degree less than the last. (I set animation to rotation counterclockwise, 360 degrees with 360 frames) I tried that code in the arrow's step event, but it didn't work. What should i do?


//create event
facedirection=0;

//step event
facedirection=point_direction(x,y,mouse_x,mouse_y)
image_single=facedirection/10;<< dont get it too high or its going to be turing real slow