[quote data-userid="1965" data-postid="91609"]
Hello all!
I have been considering creating a custom movement script in which Dizzy can gather momentum by going down a slope and use it to go up a slope and "get air" - basically skiing. The only problem is I'm not sure where to start with that, I imagine the code for falling and rolling could be useful here. Any suggestions on how to realise this crazy idea? {yolkfolk}:scratch:
If not don't worry you can still help me! I've got another problem, I have an underwater collider object that manually kills Dizzy, however when Dizzy respawns his air level is not reset, why might that be happening and how can I fix it?
Wait! Here's another problem you can think about if you really want a challenge: how might one create scrolling text (without having a special tile for the text in question)? What I mean is having a box with text that moves but does not go beyond the limits of the box, that is to say the scrolling text only displays within the proscribed limits of the box.
Sorry for the bizarre questions! {yolkfolk}:blink:
Thanks in advance! :tup:
[/quote]
Hi Andrey, well done on working out the air level and good luck with the skiing idea - that sounds really hard.
I can't help you with that, but I can help you with the scrolling text I think. I'm imagining something like the scrolling texts in Dizzy I, is that right?
You'd need a tile with the full text saved in the tiles folder and then you'd change the mapping coordinates to achieve the scrolling effect. I don't think there's a way of doing it without putting the full text on a tile, but you don't need to animate it, just have the text and a bit of space before and after.
One way is to use the Hud Handler and the HudDrawTile function:
HudDrawTile( text, 0,184,256,8, x,y,w,h, 0, 0 );
The co-ordinates I've labelled x,y,w,h are the mapping co-ordinates on the tile, so to do scrolling text you need to change the x co-ordinate whilst keeping everything else the same. So something like:
x = GameGet(G_COUNTER);
HudDrawTile( text, 56,132,128,8, x,0,128,8, 0, 0 );
Then in the Game Handler or elsewhere a bit of code like:
x = GameGet(G_COUNTER);
GameSet(G_COUNTER,x+1);
if(x>255) GameSet(G_COUNTER,0);
You can't put the counter in the Hud handler because the hud updates at different speeds on different computers.
The other way is to use an object on the map. You can see on the map editor (BRUSH properties) that the mapping co-ords are from #7 to #10. Weirdly, they aren't named in the code so to edit them you need to write ObjSet(idx,7,edit); or ObjSet(idx,8,edit); etc.
But to do your text, you only need to change object property #7, which you can do much the same way as above, maybe calling it from an UpdateRoom function.
Hope that helps you out mate. :smile:
EDIT: Actually, it just occurred to me, both Spellbound Dizzy and Dizzy and the Other Side have a mine cart ride with a jump in it. Those might be a good places to start with your ski-jump idea.
EDIT 2: Illusion Island too.