Page 1 of 1
I would Like my Player to walk down a slope

Posted:
Tue Jul 31, 2007 11:52 am
by ozziedave
Hi All,
I would like my Player Sprite to walk down a slight slope, the tile I would like it to run down is fairly long, not small 64x64 square tiles.
As with all larger Tiles it has to be either an oblong or square and the curve is made were the rest of the square/oblong is masked out.
When my Player walks on the slope he just follows the oblong tile at the top and does not go down the slope, this means that he is
seen walking on air.
I have Multimedia Fusion and the Player automatically follows the slope
without any trouble at all.
Any help would be much appreciated.

Posted:
Tue Jul 31, 2007 1:38 pm
by pixelpoop
did you add gravity to your game?
Their is a tutorial for it:
Goto the Help menu -> Game Stuff ->Gravity

Posted:
Tue Jul 31, 2007 3:39 pm
by supa-tails
Me and Automail10 have a tutorial on this page that covers gravity, simple gravity would be to add a drawactor with a script editor saying:
yvelocity + yvelocity = .3
and here is something I found to flip pictures.

Posted:
Tue Jul 31, 2007 4:58 pm
by automail10
Your right supa-tails. Freddy also has a tutorial reply.

Posted:
Tue Jul 31, 2007 6:25 pm
by supa-tails
Oh yeah

Posted:
Tue Jul 31, 2007 11:43 pm
by Game A Gogo
HOT TIP!
For real gravity factor, used
- Code: Select all
yvelocity*=.16
and on create actor, is where you would define the weight
NOTE:
Use .16 for 60fps and .32 for 30fps.
alternative and more accurate version:
- Code: Select all
yvelocity*=(9.6/real_fps);
Whit this, you will be sure to add a more realistic effect in your games, but remember to add a limit to the falling, which would be 9.6 pixel per frame.
Completed Velocity Tut but still falling

Posted:
Thu Aug 02, 2007 9:04 am
by ozziedave
Hi All,
I digested all the posts and also ran the demo"Velocity" Made an event "Draw Actor"
with Code: Yvelocity = Yvelocity +.5; then a right key response Capt_Kid.xscreen += 3;
The captain stands on an image tile, when he is moved with the Right arrow he moves a
few inches and then drops past the tile to oblivion.
What am I doing wrong please.
The first sprite Image shows him standing on the pipe, the second is when he is slipping down past the tile.
http://img2.freeimagehosting.net/uploads/bc8310b966.jpg

Posted:
Thu Aug 02, 2007 10:18 am
by pixelpoop
Do you have a physical response set so he won't go past the tiles? Look at the demo under help -> Events and Actions -> physical response.
You may also be running into a problem if your velocity gets to high. You should cap it off by putting your velocity increase inside an if statement, like this:
if (Yvelocity<4){Yvelocity = Yvelocity +.5;}
Note: GE looks at every frame and looks to see if there is a collision happening which you have set it to look for. It is possible for your Yvelocity to get so high that your actor never collides with the ground. In one frame he would be above the ground and the next he is below it. So GE never sees the collision. To help eliminate this you could make your ground blocks deeper so their is more to collide with and also you should cap your yvelocity.
Game Editor seems to have a problem with curves

Posted:
Thu Aug 02, 2007 11:25 pm
by ozziedave
Hi all & pixelpoop,
I tried all of the suggestions, but still my Player falls off of my curved platform,
I now believe that Game Editor has a problem with curves.
Most of the demo games revolve around straight surfaces, when you try the
basic demo “Caveman.ged” walk him onto the rocks near the dead tree, then
walk him along the rocks and he falls into oblivion.
I can get my Player walking on flat surfaces but curves, NO WAY.
Thanks for your continued help, most appreciated.
Ozzie Dave

Posted:
Fri Aug 03, 2007 12:52 am
by d-soldier
Ozziedave, post a screenshot that shows both the collision map sprite, and the player sprite so I can check something, and perhaps help you out.
d-soldier

Posted:
Fri Aug 03, 2007 1:41 am
by ozziedave
Hi d-soldier,
See my post sect 7 this page, has a link to image.
Many Thanks

Posted:
Fri Aug 03, 2007 1:54 am
by d-soldier
If you want to zip up the entire game and send it to me, I'll take a look at it and try to get your desired effect working.
d-soldier zip file for you

Posted:
Fri Aug 03, 2007 6:24 am
by ozziedave
Hi d-soldier,
Here is the start of my first effort that has stalled due to gravity.
Cheers

Posted:
Fri Aug 03, 2007 7:02 am
by d-soldier
Ozziedave, there were a few problems in the file which prevented you from getting your desired results. First of which, only your first platform actor had a collision-event/physical response which was set to repeat. Anything you are going to walk on needs to have "REPEAT WHILE COLLIDING" set to yes. A better way to accomplish this would be to draw your level using your tiles, and then have a separate tile actor (of plain white boxes or the like) which you lay above the graphics to act as your collision map, which reduced the number of objects GE needs to run collision checks with every frame, thus optimizing the game itself. Another problem which will need to be considered is the Captain Sparrow sprites, which due to the jerky leg kicking are not the best choice of sprites to use in a game with such curvy landscapes due to the way collisions work in accordance with physical responses... Anyway, I'm uploading a modified GED file, which you can place back into the directory with your own (still needs the /data directory on your pc as I am not uploading all the graphics again). Let me know if this was the desired effect.
d-soldier many thanks

Posted:
Fri Aug 03, 2007 9:19 am
by ozziedave
d-soldier thank you for fixing my problem, it has allowed me to further
my plan to make a couple of games for my GP2X when ever they
dispatch it, soon I hope.
One again thank you for taking the time to help me, much appreciated.
I will take onboard those helpful hints also.
Cheers
The wonders of the internet.
Ozzie