Jump to content


OMAGA

Member Since 03 Jul 2010
Offline Last Active Oct 23 2011 11:20 PM

Posts I've Made

In Topic: Making an enemy move to the character.

19 July 2011 - 09:05 PM

Now that its tomorrow (for me anyways),  here is the full script...


if distance_to_object( Obj_player ) < 150 && !collision_line(x ,y ,Obj_player.x ,Obj_player.y ,Obj_wall ,1 ,1 )  {
	direction = point_direction(x ,y ,Obj_player.x ,Obj_player.y )
}




Place the code in the step event of your enemy

"Obj_player" can be replaced by any object you want your enemy to go towards
"150" is the max distance the enemy can be until the player is out of sight (Change it as you please)

the arguments for collision_line are:      collision_line(x1 ,y1 ,x2 ,y2 , obj ,prec ,notme)


Without the collision_line it looks like this:

if distance_to_object( Obj_player ) < 150  {
	direction = point_direction(x ,y ,Obj_player.x ,Obj_player.y )
}



Enjoy  Posted Image

In Topic: Pointers

19 July 2011 - 08:35 PM

Its not that I actually need it, it was just something I wanted to practice because I'm learning cpp. I'm not entirely sure why you would use pointers, but the lessons I have made them sound like a very powerful addition to programming, had something t do with the way arithmetic is done on them.

In Topic: Making an enemy move to the character.

19 July 2011 - 08:02 AM

Use:

if distance_to_object(your player) > distance you want  {
point_direction}

Look those functions in the help file. I would write it all for you but I'm mobile right now. If someone else doesn't I will write it Tommorow.

Also you can use the function "collision_line" to make enemy only chase if there is a direct line from enemy to player

In Topic: about spriting

18 July 2011 - 08:08 PM

Sorry, but great sprites are not made that way unless you have LOTS of patience with ms paint
You need the proper software tools to do that, and there are many options. I use Blender 3D along with photoshop, however Blender is quite a complex program if your just starting. You may want to learn  GIMP, its free and open source (so is Blender). Paint.NET is also free. But if you are interested with doing the slow labor intensive work of pixel art you can try the program mtPaint.


http://mtpaint.sourceforge.net
http://www.getpaint.net/
http://www.blender.org/
http://www.gimp.org/


Its allot of work to learn one of these programs, but you will be very happy you did. (I suggest Blender and GIMP, for intermediate to advanced, the others are simpler)

In Topic: Sprite Question

18 July 2011 - 07:55 PM

If this is a competition shouldn't you be doing it yourself?