DizzyAGE General Coding Queries

Need help with using DizzyAGE then look here
delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Post by delta » Thu Jul 09, 2015 3:38 pm

If you can, it's a lot lot simpler to have the whole game using one map. Trust me on that!
Image

Image

"Quotes from the internet may not be genuine" - Abraham Lincoln

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

Post by AndyG » Thu Jul 09, 2015 9:12 pm

I'll give it a go then, thanks! Like the last one, this game is all about learning - so far I've learned to delay the HUD, put a "load game / new game" option at the start, and define all the cutscenes in a separate .gs file. I'll see how it goes! :D

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

Very simple scrolling

Post by AndyG » Mon Sep 21, 2015 4:23 pm

Hi 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.
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 advice :)

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

Post by Noggin the Nog » Mon Sep 21, 2015 8:08 pm

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:

Code: Select all

GameSet(G_PARALLAX,PlayerGet(P_ X) );
Then, put this bit in the GameAfterUpdate Handler:

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);
}
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.

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

Post by AndyG » Mon Sep 21, 2015 8:19 pm

Fantastic! Just what I needed, and I'm glad it's so simple. I was combing Jewel Thief for clues, but I found it way too difficult with the smooth scrolling. Thanks a lot :tup:

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

Post by AndyG » Sun Oct 11, 2015 5:08 pm

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

Code: Select all

GameSet(G_PARALLAX,PlayerGet(P_ X) );
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 :v2_dizzy_cry:

Meph
Hard Boiled Egg
Posts: 2959
Joined: Fri Apr 13, 2007 12:47 am
Location: England, Suffolk
Contact:

Post by Meph » Sun Oct 11, 2015 6:25 pm

Maybe use need to use the Room function command to activate the scrolling when Dizzy enters that room?
Its always the cracked ones that let the light in

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

Post by AndyG » Sun Oct 11, 2015 7:48 pm

That... worked... :v2_dizzy_yahoo: :v2_dizzy_yahoo: :v2_dizzy_yahoo: :dizzy_biggrin: :v2_dizzy_cheers:
For some reason I would never have thought of that. I guess I still don't fully understand, but that's one more obstacle over! Thanks a lot

Meph
Hard Boiled Egg
Posts: 2959
Joined: Fri Apr 13, 2007 12:47 am
Location: England, Suffolk
Contact:

Post by Meph » Tue Oct 13, 2015 7:04 pm

Excellent. glad it worked.
Its always the cracked ones that let the light in

Post Reply