My little helper sucks

Posted by jimbob on Jan. 22, 2007, 10:12 a.m.

I've randomly worked out a weapon system. You press a key to cycle through the weapons you have and ammo is displayed along with whatever weapon is equipped. However…

I want the player to be able to actually AIM. With a CROSSHAIR. How am I meant to do this?! If the game is going to look nice, the guy's arm needs to move with the crossshair. But I'll need to rotate sprite. I DON'T HAVE REGISTERED. DAMN IT AGAIN.

Plus, the crosshair will need to move in a circular movement and around the player, using arrow keys up and down. I dunno how I'm gonna get this to work, but I'll figure it out somehow.

Now about the spriter. He does nice sprites. Very nice sprites. To the point of being tasty. But I don't know whether he's in or out yet. Because he FORGOT the PASSWORD to his COMPUTER.

Damn it.

Comments

Castypher 17 years, 3 months ago

Register, I don't think there's another way to make his arm point to the crosshairs. When you do register, use image_angle.

jimbob 17 years, 3 months ago

thanks for the tip, but I still have to make the crosshairs work first!

Castypher 17 years, 3 months ago

I don't know how you're going to do the crosshairs. Maybe check if the distance is too great, then set it to the maximum distance.

jimbob 17 years, 3 months ago

thanks for your help!

My philosophy for my current project:

GIVE THE USER FULL CONTROL.

yer!

Castypher 17 years, 3 months ago

I guess you should let them move the crosshairs all over the screen, or lmit it to vertical or horizontal.

jimbob 17 years, 3 months ago

na, I want it sort of like worms (but not as slow)

Up and down arrow keys to aim

Left and right to move.

Crosshair can only move about 180 degrees

Because in my first version of Codegame you could only shoot at one angle and sometimes the enemies would come at you at an angle and you couldn't get them.

Castypher 17 years, 3 months ago

I suggest using point_distance and point_direction.

Step Event:

//only move in a 180 degree angle
if point_direction > 180
  point_direction = 180
if point_direction < -180
  point_direction = -180

//set the max distance
if point_distance > 100
  point_direction = 100

Something like that. That's my best guess.

jimbob 17 years, 3 months ago

thanks Kilin, I'll try it out and see.

Cesque 17 years, 3 months ago

You don't need a registered version. Use a rotated sprite moving at speed 0 towards the point at the crosshair, and for rotation, use this:

image_index=direction*image_number/360

Of course, you need to use more sprites this way.

jimbob 17 years, 3 months ago

!!!

Thank you very much! I tried out lots of methods, including Kilin's, but to no avail. I'll try this out. Thanks again.