Jump to content


Dash the Ultimate Warrior

Member Since 23 Feb 2007
Offline Last Active Sep 06 2009 02:48 AM

Topics I've Started

Weird Problems Occur When Running/jumping

31 August 2009 - 01:45 AM

This is really weird. The jump sprite is just one frame (for now, since I'm still grappling with the animated jump situation shown here.)

Posted Image
He jumps just fine when he's standing still, but when you make him run left or right, the jump sprite for left or right will be replaced with a single frame of his running left or right animation, like so...
Posted Image

Now I'm not sure precisely what line of code is the culprit, but here is the code for the gravity/jump sprites.
if (place_free(x, y + 1))
{
	gravity = 0.5;
	can_shoot = false;
	airborne = true;
	
	// Sprite check (jump)
	if aimdir = 3 or aimdir = 4 or aimdir = 5
	{
		sprite_index = spr_p1_jump_R;
	} else {
		sprite_index = spr_p1_jump_L;
	}
		
} else {
	gravity = 0;
	can_shoot = true;
	airborne = false;
	
	// Sprite check (idle)
	if aimdir = 3 or aimdir = 4 or aimdir = 5
	{
		sprite_index = spr_p1_idle_R;
	} else {
		sprite_index = spr_p1_idle_L;
	}
}

Other than that, I just have him jump when S is pressed (if place free then vspeed = -5). In addition, two more minor bugs are present - sometimes when you land and switch directions rapidly, you'll get stuck in the ground until you jump again, and he only stays in the jump sprite as long as S is held down.

Here is the link to the game file...I'd love some glances at the code if you haven't already figured it out.

Jump Animation Confusion - Pre-jump And Landing

12 August 2009 - 07:37 PM

I want my character to, upon pressing the jump button, follow the pattern of my sprite as shown here:
Posted Image

Namely, I'm trying to get him to do the pre-jump before stopping in the fully airborne (arms outstretched) pose as long as he's in the air, then finishing the animation upon landing. I've thought of doing this several ways:

First-off, I could split the whole thing into three separate sprites (pre-jump, jump and land) and use the "animation end" event, but as far as my knowledge goes that would be a bit cumbersome, especially since he has to do this for both left and right-facing sides, and there are dozens more sprites I am needing to have him switch to in-game.

Another thought would be something like this (forgive my pseudocode):
if(jumping = true) {
sprite_index = jumping sprite;
}
if(object is moving up) {
image_index = so and so;
}
if(object collides with surface) {
image_index = so and so;
}

To get even cooler I could have him stop on one of the more "upward" poses when moving up, then switching to one of the more "downward" ones as he begins his descent. But I am somewhat lost here, and was wondering if you'd be willing to help out.

Trouble With Shooting Animation

09 April 2009 - 09:26 PM

I am coding a run n gun game where the player character is supposed to stop and fire a single shot each time the player presses S. However, the animation keeps looping as long as S is held down...not at all what I want (unless I decide to include a machine gun or flamethrower or continuous laser powerup later on.) Here is the code from the shooting script for the Player 1 object:

// Shooting Script
can_shoot = true;
can_move = true;

//Check for key press
if (keyboard_check(ord('S')))
{
	can_move = false;
	image_speed = 0;
	
	// Shoot Left
	if (face = 0 && can_shoot = true)
	{
		sprite_index = spr_p1_shoot_L;
		image_index += 1;
	}

	// Shoot Right
	if (face = 1 && can_shoot = true)
	{
		image_index += 1;
		sprite_index = spr_p1_shoot_R;
	}
	
	//control the animation
	if (image_index > 5)
	{
		image_speed = 0;
		can_shoot = false;
	}
	
//Free the position
}else{

	can_move = true;
	can_shoot = true;
}

Perhaps it has something to do with this code being in a script which is called from the object's step event? I'm not sure...

Sprites Wanted For Run 'n Gun Game

15 March 2009 - 12:29 AM

Hello,

I am in the process of beginning a side-scrolling run n' gun/varied combat game like Contra, Gunstar Heroes, etc.

My existing spriter has not been in touch with me for almost a week and this project must be started, a playable engine completed within the next 2 months. I'll get nowhere if I wait for him, but at the same time I need sprites to work with in order to properly begin coding the engine...normally I'd do the code first but since the player/level/item/enemy sprites are so critical in this kind of game I cannot begin coding until at least a few animations are completed.

If you agree to do this, your name and effort will be credited. If you insist, I am also willing to pay you up to 10 dollars per-pose/animation.

The player sprites need to be within a 64 x 64 image, no larger, but can be cropped to fit if needed to do so. The art style I am looking for is somewhat realistic but definitely old-school (SNES/Genesis style,) similar to the style used in Shinobi for the Sega Genesis.

Please give your email and if you have it your AIM name...I will email you the pictures of what I need sprited. I communicate best over AIM.

My AIM username is DavinFeive
My email address is adept25@pacbell.net

Please respond, and I hope to hear from you soon :P

View Projection Troubles

02 November 2008 - 11:57 PM

I am working on an overhead shooter/action RPG-type game, but I am facing some serious trouble with one particular part. The current sprite is just a stick figure to test the engine out (engine is available for download at the bottom.)

You use the WASD keys to move, and the mouse to aim. How it's supposed to work is that the WASD keys move him around classic RPG-style (up, down, left and right sprites, though I added four diagonal directions for a wider field of movement,) and the mouse aims and fires his weapons (left button is melee, right button is ranged. I'll worry about that later.) Most important, however, is that the aiming crosshairs/cursor SHOULD be confined to within the triangular field of view in front of whatever direction the player is facing. I tried this with a large triangular sprite (as the current source code has) and failed miserably.

Okay, this is what I want to do. I want to somehow draw a triangle starting at the player object's origin, then widening out as it goes forward. The field of view must be aiming in the correct direction in relation to the direction of the player, and confine the cursor to within the triangle's boundaries. I currently have no idea how to do that...help is greatly appreciated.

Here is a snapshot of my current (messed-up) game:
Posted Image

Download the source so far here. It is a GM7 file. You need the registered version to use it too.