Jump to content


A saurus1

Member Since 11 Oct 2007
Offline Last Active Today, 11:36 AM

Posts I've Made

In Topic: 4 Directional Laser

Today, 11:37 AM

I'm not sure what you mean by a short burst laser (do you want one that shoots like a blaster pistol might or one that is a continuous line, like a real laser, but which fades out over distance), but this should not be difficult.

 

You probably should have a separate varaible defining your character's facing direction, incase you want to go back later and change sprites or something, but either way, you'll want to do something with a switch statement:

switch (sprite_index)
{
case sPCWalkingRight:
    //create the laser to the right
break;
case sPCWalkingDown:
    //create the laser down
break;
//etc...
}

The switch statement is basically a bunch of if statements smashed together. It compares the variable given (in this case, sprite_index), with each "case," and, if a match is found, executes the code below that "case" until a "break" statement is reached.

 

As for drawing the actual laser, you'll probably end up using draw_line, but you can also use a sprite and scale it to produce a similar effect with the added benefit of being able to better control how your laser looks. I'd need to know more about what exactly you're looking for.


In Topic: Line At Edge Of Screen

21 May 2013 - 10:51 AM

I actually don't see the line in the picture above. Maybe I'm blind or something.

 

EDIT: Oh, wait, now I do.


In Topic: Jumping: Wondering How I Could Do This

21 May 2013 - 10:50 AM

however, there might still be some options where the character won't be able to reach the next point (quite obvious actually).

I'm not sure of the content of the game, but you do get this effect in player-controlled platformers too.


In Topic: Jumping: Wondering How I Could Do This

20 May 2013 - 11:28 AM

As jo-thijs said, there are multiple solutions to each trajectory, so you'll need to make some decisions. However, you can usually subject yourself to some constraints which make the choice of path easier. For example, you want your character to move at an approximately constant speed horizontally, so make sure that your hspeed stays near the same value (on any given jump, it would be okay to increase the hspeed or decrease the hspeed a tiny bit, to mimic how a character might apply more force in the vertical or horizontal direction, but it shouldn't change noticeably). Also, you can probably constrain your vspeed to a certain value, as your character probably doesn't have infinite jumping power.

 

The best way to do this would be to keep your character's total force applied to each jump constant. In other words, the magnitude of his initial velocity is the same for each jump. This allows you to redefine vspeed as vspeed = sqrt(sqr(someconstantspeed) - sqr(hspeed)) from the pythagorean theorem, and should reduce the number of variables you have to pre-determine to 1 instead of 2.


In Topic: Need Help With A "Lights Out" Puzzle Type Game

20 May 2013 - 11:21 AM

Yeah, I just had to put those numbers in there, but I figured you could change them if you needed to. Is there anything else we can help with?