Jump to content


Chessmasterriley

Member Since 27 Feb 2005
Offline Last Active Today, 05:15 AM

Posts I've Made

In Topic: How To Get A Objects X And Y Position

20 May 2013 - 05:56 PM

The cool thing with the array system is you can still do just that - all you have to do is check the arrays x/y values to see if they are outside of the view, and then just remove them.

In Topic: Top Down Field Of View

20 May 2013 - 05:51 PM

While that's an awesome idea, it would be difficult to implement in any realtime manner. The sheer number of collision checks you are make is enough to slow down any game. You might be able to work with it if you checked at a greater increment than 1 pixel and 1 degree, though you might suffer in accuracy. A better way to accomplish an effect like this might be to simply use a surface and cut out a sort of 'flashlight' view of where the player can see, no?

In Topic: How To Get A Objects X And Y Position

20 May 2013 - 05:45 PM

I think you misunderstand my post - I'm saying that the best method of track/non-interactive visual creation would be without creating instances at all. Instead, I recommend storing x,y,alpha,rotation variables in a grid, or separate arrays, and simply drawing them with those variables. Instances take a large amount of processing power and should be used for objects that actually need to be interacted with. Tracks are no such objects.

In Topic: How To Get A Objects X And Y Position

20 May 2013 - 05:35 PM

However, that would create an instance for every footprint visible. That would be EXTREMELY inefficient and, since they are simply visual effects, you should use arrays to create and draw them.

In Topic: A.I Assistance - A Lot Of Help Needed!

20 May 2013 - 05:28 PM

The best way, I've found, to develop AI for any type of gameplay is to think of how a PC would use something and emulate that to the best of your abilities. For platforming, you essentially want to keep the same control scheme as the player, limited to whatever that enemy may be limited by (specific skills/abilities/whatever) and then simply change what causes them to use those commands. Instead of having the keys WASD dictate movement, have a few variables (moveLeft,moveRight,moveJump) and perform those actions when those variables are true. Then create code that looks somewhat like this:
 
var px,py,distance;
px=obj_player.x
py=obj_player.y
distance=point_distance(x,y,px,py)

//code to move within range to attack
if distance>32 //you could change 32 to an attack radius or something
{
if px>x {moveRight=1; moveLeft=0}
else {moveLeft=1; moveRight=0}
if py>y and //check to see if block is in front of me
  {
  moveJump=1
  }
}
else {moveRight=0; moveLeft=0; moveJump=0}
Grr - ninja'd.