Walking script help needed!

Need help with using DizzyAGE then look here
zeropolis79

Walking script help needed!

Postby zeropolis79 » Sun May 31, 2015 10:29 pm

Hello!

I can't make heads nor tails of the instructions...

Can someone help me with a simple walking and jumping script for Dizzy please and tell me how to implement it..

If someone can explain it to me, I can work from there..

Many thanks!

Grandad
Hard Boiled Egg
Posts: 1309
Joined: Sat Aug 08, 2009 10:47 am
Location: Balham - gateway to the south

Postby Grandad » Mon Jun 01, 2015 9:22 am

The jump command is PlayerEnterJump with the direction and power in brackets (it's in the player.gs file) ie:

Code: Select all

PlayerEnterJump(-1, 5);       make Dizzy jump left a little bit
PlayerEnterJump(0,10);          make Dizzy jump up a little bit highter
PlayerEnterJump(1, 15);       make Dizzy jump right even higher


Walking Dizzy can be done with a simple function but it won't let him walk through block material. The (posx) in brackets is the x position you want Dizzy to finish (must be divisible by 4 & add 12 (as the x positon is in the middle of the walking tile for the player). Add this to the util.gs file for convenience.

Code: Select all

func PlayerEnterWalk(posx)
{
while(true) //game pauses whilst Dizzy is walking
{
ClearKeys();
x = PlayerGet(P_ X) ;
if (x < posx)
SetKey(KEY_RIGHT, 1);
else
if (x > posx)
SetKey(KEY_LEFT, 1);
else
return;
stop;
}
}

So, as a basic example if you want Dizzy to walk right to a certain position but jump over a boulder in the process the basic script will be:

Code: Select all

PlayerWalkTo(xxxx); //x position just before the boulder
PlayerEnterIdle();
PlayerEnterJump(1, 6); //jump the boulder
// you might have to add a WaitFrames(xx) command to pause whilst the jump is being done
PlayerEnterIdle();
PlayerWalkTo(xxxx); // final x postition
PlayerEnterIdle();
return;


and can just be included as part of an ActionObject or CollideObject function.

Hope this is useful.

zeropolis79

Postby zeropolis79 » Mon Jun 01, 2015 11:09 am

So you have to calculate where all the things are that Dizzy will need to jump over or onto like platforms? Didn't think the walking and jumping part would be so complex..

Thanks for the help.. I think I'm better off giving in.. Just wanted to code a mini-game to tie in with my book. Designed part of a map already..

User avatar
Adz.M
Team Yolkfolk
Team Yolkfolk
Posts: 2944
Joined: Tue Jan 16, 2007 7:43 am
Location: Cornwall, UK
Contact:

Postby Adz.M » Mon Jun 01, 2015 12:19 pm

You shouldn't have to do any calculating or do anything with the way Dizzy moves.

What I did when I built the Crystal Kingdom map and tested it, is edit the map file that should be in the DizzyAGE folder called 'game'.

I don't know if this will help in any way, but on the site, we have something called "Make your own Dizzy game" by Jamie Douglas, this also has a manual that Jamie created that talks about coding enemies, items, puzzles etc.

http://www.yolkfolk.com/media/downloads/MakeYourOwnDizzyGame.zip

zeropolis79

Postby zeropolis79 » Mon Jun 01, 2015 12:50 pm

So i could take the walking code from that map file you mentioned and apply it to my map

User avatar
Adz.M
Team Yolkfolk
Team Yolkfolk
Posts: 2944
Joined: Tue Jan 16, 2007 7:43 am
Location: Cornwall, UK
Contact:

Postby Adz.M » Mon Jun 01, 2015 1:24 pm

The walking and jumping script should already be coded. You shouldn't have to do that yourself.

zeropolis79

Postby zeropolis79 » Mon Jun 01, 2015 3:01 pm

Are you saying it's already there, I just need to apply it to the Dizzy sprite? Thanks

User avatar
Noggin the Nog
Hard Boiled Egg
Posts: 407
Joined: Sun Jul 01, 2012 12:04 am

Postby Noggin the Nog » Mon Jun 01, 2015 3:06 pm

Hi Zeropolis,

Your question's confusing to me. When you download DizzyAGE, you start with a couple of rooms and a dizzy sprite which can already walk, jump etc.

Are you saying you want to modify Dizzy's movement, to make him jump higher or something? Or are you saying that when you run the game Dizzy doesn't appear?

All the code for Dizzy's movement is already there. You don't need to write any of it.

zeropolis79

Postby zeropolis79 » Mon Jun 01, 2015 3:59 pm

I just want to get Dizzy to move in my own map and I can't do it!

If I send my map file to someone, can they help with it please?

AndyG
Hard Boiled Egg
Posts: 208
Joined: Thu May 22, 2014 1:54 pm
Location: UK
Contact:

Postby AndyG » Mon Jun 01, 2015 4:06 pm

Jamie Douglas also did some tutorial videos on YouTube which were a massive help getting me started: https://www.youtube.com/watch?v=i9Q4aMGEDOM.
If you just want to make a simple game that follows standard rules, all you have to do is draw the map and code the puzzles. All the hard work (like movement, menus, inventory, death and respawning etc) has already been done,and I don't try to understand it. Coding the puzzles is a bit of a steep learning curve, but to be honest once you've learned 3 or 4 functions you can just copy and paste them just changing the numbers (if the player drops x on y, z will appear) and have something rather good in no time at all. Don't give up!

EDIT: You can send what you have to me at andy.goulding85@hotmail.co.uk and I'll have a look :)

EDIT the second: Are you sure you're opening the right thing? When you want to test your map, you should open dizzy.exe


cron