Help With A Newbies Game

Non-platform specific questions.

Help With A Newbies Game

Postby happyjustbecause » Thu Aug 04, 2011 10:24 pm

Sorry about having to post yet another thing on my probably simple problems, but I am again at a loss! I'm not sure what to do about several things in my game. I have my character able to jump, but I am not sure how to keep the jumping animation when moving left and right in the air. Whenever I move left or right by simply walking he will fall through the tiles. And I am not sure on how to do a shooting animation while walking and have it switch back to the normal walking animation after the shot has been fired...

I am again sorry for looking to the community to help solve my problems, but help would still be greatly appreciated. It's all a learning experience before I am able to make good games anyways right?

Ok, well Thank you very much to anyone willing to help!

:D
Attachments
data.zip
Data
(208.96 KiB) Downloaded 88 times
Andrewoid.ged
Heres my game in progress...
(6.33 KiB) Downloaded 81 times
Last edited by happyjustbecause on Fri Aug 05, 2011 1:06 am, edited 4 times in total.
For small creatures such as we the vastness is bearable only through love.
-Carl Sagan

Night Knight Development Thread
User avatar
happyjustbecause
 
Posts: 267
Joined: Tue Jul 26, 2011 3:10 pm
Location: Frazier Park, Ca
Score: 15 Give a positive score

Re: Help With A Newbies Game

Postby Camper1995 » Thu Aug 04, 2011 11:19 pm

Hello,

please post data folder everytime you post a .ged file (your game).
The game needs to load from the data folder.

I suggest you zipping (or rarring) Andrewoid.get and data folder. :wink:

Thank you,

(I am able to help you)
Say hello to my little friend.
User avatar
Camper1995
 
Posts: 707
Joined: Tue Dec 30, 2008 7:20 pm
Location: Lost in the past.
Score: 44 Give a positive score

Re: Help With A Newbies Game

Postby happyjustbecause » Fri Aug 05, 2011 1:07 am

Alright, I posted the zipped up data, thanks for wanting to help!
For small creatures such as we the vastness is bearable only through love.
-Carl Sagan

Night Knight Development Thread
User avatar
happyjustbecause
 
Posts: 267
Joined: Tue Jul 26, 2011 3:10 pm
Location: Frazier Park, Ca
Score: 15 Give a positive score

Re: Help With A Newbies Game

Postby skydereign » Fri Aug 05, 2011 5:39 am

Well to fix the falling through the ground, you have to set the collision event with the PhysicalResponse to repeat when colliding. I would actually suggest you learn the state method to prevent moonwalking and generally fix any animation problems you are having, but that will take a bit of effort on your part. If you are interested pm me, and I can send you the details. For now, this is a demo of what I mean. http://game-editor.com/forum/download/file.php?id=4965

If not, then you'll need a variable to determine the actor's direction, 0 if facing right and 1 if facing left (or similar). That way when you jump, you can check if dir==0 or dir==1, and change the animation accordingly. Also on the keydown right and left events that change the animation, if you put those in script editor, you can check if the actor is jumping, and if so not change the animation (or rather change the animation if the actor is not jumping).
Code: Select all
if(cjump==1)
{
    //ChangeAnimation function call to running
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Help With A Newbies Game

Postby Camper1995 » Fri Aug 05, 2011 1:12 pm

Damn, Sky was faster. :P
Say hello to my little friend.
User avatar
Camper1995
 
Posts: 707
Joined: Tue Dec 30, 2008 7:20 pm
Location: Lost in the past.
Score: 44 Give a positive score

Re: Help With A Newbies Game

Postby foleyjo » Fri Aug 05, 2011 5:10 pm

The way I did it for Jet Set Wanley was to have 3 states

In state 1 the player was walking and there was no vertical velocity.Player was able to move left and right. There was also a check before each movement to make sure that there was floor underneath the player. To do this I used a collisionfree check. If it was free the player would move to a falling state . If the player pressed space he would move to a jumping state.

In state 2 the player was falling. In the player was unable to move left and right and the player was constantly falling down. yvelocity++. Player could not jump.

In State 3 the player was falling down. Player was unable to jump. If player was moving left or right as they jump, the player would constantly move in that direction.

If the player collided with the floor in states 2 or 3 there would be a physicalresponce and then state would change to state 1.

Also using this method I did not need to use a can jump variable.
KISS -Keep It Simple Stoopid
foleyjo
 
Posts: 275
Joined: Mon Jul 09, 2007 1:15 pm
Score: 15 Give a positive score

Re: Help With A Newbies Game

Postby happyjustbecause » Fri Aug 05, 2011 7:54 pm

Thanks for the help everyone! But I also forgot to put: How do I have it so that I can change the shooting direction depending on the direction the character is facing. That way its not always going to the right. (Face Right, Shoot Right. Face Left, Shoot Left).
Last edited by happyjustbecause on Fri Aug 05, 2011 8:02 pm, edited 1 time in total.
For small creatures such as we the vastness is bearable only through love.
-Carl Sagan

Night Knight Development Thread
User avatar
happyjustbecause
 
Posts: 267
Joined: Tue Jul 26, 2011 3:10 pm
Location: Frazier Park, Ca
Score: 15 Give a positive score

Re: Help With A Newbies Game

Postby skydereign » Fri Aug 05, 2011 8:00 pm

Well if you add the dir variable you can do this for your attack button.
player -> Key Down Space -> Script Editor
Code: Select all
if(dir==0) // right
{
    CreateActor("bullet", "bullet_anim", "(none)", "(none)", 0, 0, false)->xvelocity=10;
}
else
{
    CreateActor("bullet", "bullet_anim", "(none)", "(none)", 0, 0, false)->xvelocity=-10;
}


To make the actual dir variable work, make sure to have on your keydown right script, set dir to 0, and on your keydown left script set it to 1. Then the above code should work. Also not that the speed that the bullet moves is determined by the above code (the 10), so if you have the xvelocity code in the bullet's create actor, remove it. However you can use 1 and -1 if you don't like using ifs (xvelocity*dir).
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Help With A Newbies Game

Postby foleyjo » Fri Aug 05, 2011 10:25 pm

do it without the if and have dir = 1 or -1 , then make xvelocity = 10 * dir

i've been reading the thread about data control
KISS -Keep It Simple Stoopid
foleyjo
 
Posts: 275
Joined: Mon Jul 09, 2007 1:15 pm
Score: 15 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest