DizzyAGE General Coding Queries
Very simple scrolling
Back to this! I'm trying to create a scrolling game with only one background, which moves left and right according to the player's X. At the moment, my background is static a la Pirate's Life Dizzy. I think a very simple way to implement it would be to just check if the player is walking left, and increment the X of the background, and vice versa. But how can I check? I can only see PlayterGe(P_STATUS)==STATUS_WALK, which doesn't define left or right. Thanks for any adviceHi Andy, when you say 2 layers, you mean just Dizzy's layer and a sky background? You can find that in Pirate's Life Dizzy and it's very easy to do.
If you want to add more layers without the smooth scrolling, I can tell you how to do that - it's not that hard if the scrolling is only horizontal.

- Noggin the Nog
- Hard Boiled Egg
- Posts: 431
- Joined: Sun Jul 01, 2012 12:04 am
If I remember right, the way I did this was as follows:
Define a new game variable, then put this line in the BeginNewGame function, and at the top of the PlayerUpdate Handler:
Then, put this bit in the GameAfterUpdate Handler:
That should move your background left and right at half the speed Dizzy walks. You can change the fraction to 1/4 or 3/4 by editing the "/2" in the code above.
BTW, this might not work if you're using the smooth scrolling code I posted before. In fact I'm pretty sure it won't.
Define a new game variable, then put this line in the BeginNewGame function, and at the top of the PlayerUpdate Handler:
Code: Select all
GameSet(G_PARALLAX,PlayerGet(P_ X) );
Code: Select all
step = ( PlayerGet(P_ X) - GameGet(G_PARALLA X) ) / 2;
if(step!=0)
{
back = ObjFind(100);
ObjSet(back,O_X,ObjGet(back,O_ X) + step);
ObjPresent(back);
}
BTW, this might not work if you're using the smooth scrolling code I posted before. In fact I'm pretty sure it won't.
OK I have another problem re: the scrolling. I always try to resolve this stuff myself but this one has been doing my nut for about a week now. Basically, my game starts indoors (interiors are on the top row of screens) and when you leave the house (4th row) it's stormy. After the first part of the game, the weather changes and that's when my parallax scrolling comes in. Except it doesn't. As I've been testing the game, I've been starting the player outside, and everything works as it should. So I suppose my question is: does the player NEED to start on the same screen as where the scrolling will begin? Because this will screw my intro up if I can't find a way around it. I've tried putting elsewhere than within the BeginNewGame function and it doesn't seem to do anything.
Sorry that's very vague. I hope there's a simple solution but I suspect it will get complicated
Code: Select all
GameSet(G_PARALLAX,PlayerGet(P_ X) );
Sorry that's very vague. I hope there's a simple solution but I suspect it will get complicated

Re: DizzyAGE General Coding Queries
Hi all, original long term Dizzy fan here trying his hand at Dizzy Age. I've been been working through the Jamie Douglas "Make Your Own Dizzy" tutorial, I have little coding experience but I get the basics and I'm picking it up quickly enough, adding a few of my own things in there.
The tutorial includes a small water area you can enter with aqualung gear, it also talks you through the settings for draining energy from the player when entering water, without aqualung, before eventually drowning. At this point I seem to have ran into a problem with the safe respawn position of the player, I have worked out that the the game is seeing the river rock bed as a safe respawn point as the player is in contact with it before their energy is fully depleted, the result being that after death the player appears back in the water and dies again before being able to make it out.
I have been though the code and spotted a note that suggests the ability to create custom respawn points but I am not exactly sure how to do this and link it to the death in water (seems that a safe respawn point for water would be a single global command rather than a bespoke....).
Not really sure that this IS the answer, it may be I have a simple property/setting incorrect but I just can't see the wood for the trees.
Any help much appreciated, this is the last bug I have before completing my first small demo !
The tutorial includes a small water area you can enter with aqualung gear, it also talks you through the settings for draining energy from the player when entering water, without aqualung, before eventually drowning. At this point I seem to have ran into a problem with the safe respawn position of the player, I have worked out that the the game is seeing the river rock bed as a safe respawn point as the player is in contact with it before their energy is fully depleted, the result being that after death the player appears back in the water and dies again before being able to make it out.
I have been though the code and spotted a note that suggests the ability to create custom respawn points but I am not exactly sure how to do this and link it to the death in water (seems that a safe respawn point for water would be a single global command rather than a bespoke....).
Not really sure that this IS the answer, it may be I have a simple property/setting incorrect but I just can't see the wood for the trees.
Any help much appreciated, this is the last bug I have before completing my first small demo !