Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, TedMar), 1,031 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Switching levels/maps #371929
05/26/11 17:18
05/26/11 17:18
Joined: May 2011
Posts: 7
D
Darrel Offline OP
Newbie
Darrel  Offline OP
Newbie
D

Joined: May 2011
Posts: 7
So, here is my non-working attempt at it. I would appreciate it if someone could show me how it's supposed to be done. I was attempting to make this switch levels on mouse click.


#include <acknex.h>
#include <default.c>


function main()
{
screen_size.x = 800;
screen_size.y = 600;
screen_color.blue = 150;
mouse_mode = 4;
}

function begin_level()
{
while (key_any) {wait (1);}
level_load("ID.wmb");
}


PANEL* main_pan =
{
bmap = "Background.png";
pos_x = 0;
pos_y = 0;

button (518, 520, "Singleplayer2.png", "Singleplayer.png", "Singleplayer2.png", begin_level, NULL, NULL);
flags = OVERLAY | SHOW;
}

Re: Switching levels/maps [Re: Darrel] #371932
05/26/11 17:26
05/26/11 17:26
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Try taking 'while (key_any) {wait (1);}' out of your 'begin_level()' function.

Re: Switching levels/maps [Re: DJBMASTER] #371938
05/26/11 18:00
05/26/11 18:00
Joined: May 2011
Posts: 7
D
Darrel Offline OP
Newbie
Darrel  Offline OP
Newbie
D

Joined: May 2011
Posts: 7
It's still the same result. The script loads but the button doesn't work.

Last edited by Darrel; 05/26/11 18:01.
Re: Switching levels/maps [Re: Darrel] #371940
05/26/11 18:15
05/26/11 18:15
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I think
"Singleplayer2.png"
is an invalid parameter, you need to use a predefined BMAP pointer.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Switching levels/maps [Re: Superku] #371943
05/26/11 18:29
05/26/11 18:29
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
I just tried your code and it works so I don't see what the problem is. Are you getting some kind of error message?

Re: Switching levels/maps [Re: DJBMASTER] #371946
05/26/11 18:47
05/26/11 18:47
Joined: May 2011
Posts: 7
D
Darrel Offline OP
Newbie
Darrel  Offline OP
Newbie
D

Joined: May 2011
Posts: 7
Nope, no error messages are showing. It starts as a menu page and is supposed to switch to a wmb level on click. Maybe it has something to do with the level I'm trying to load into it. But the level on its own loads as well.

Scratch that, I just tested it and before I clicked the button, my fps was at about 290, after it was like 57. So I think the level is loading, but it's still displaying my background.png.

Last edited by Darrel; 05/26/11 18:55.
Re: Switching levels/maps [Re: Darrel] #371951
05/26/11 19:34
05/26/11 19:34
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: Darrel
So I think the level is loading, but it's still displaying my background.png.

Ever thought of making it invisible?


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Switching levels/maps [Re: WretchedSid] #371999
05/27/11 06:04
05/27/11 06:04
Joined: May 2011
Posts: 7
D
Darrel Offline OP
Newbie
Darrel  Offline OP
Newbie
D

Joined: May 2011
Posts: 7
Of course I thought of it, but I don't have the slightest clue as to how to do that. I'm new to Lite-C.

Re: Switching levels/maps [Re: Darrel] #372026
05/27/11 12:24
05/27/11 12:24
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Place 'reset(main_pan,SHOW);' in your 'begin_level()' function. set/reset and toggle are macros (a set of little instructions) that can be used to change the flags of an object at runtime.

Re: Switching levels/maps [Re: DJBMASTER] #372031
05/27/11 13:22
05/27/11 13:22
Joined: May 2011
Posts: 7
D
Darrel Offline OP
Newbie
Darrel  Offline OP
Newbie
D

Joined: May 2011
Posts: 7
function begin_level()
{
level_load("ID.wmb");
reset(main_pan, SHOW);
}

That's what I got, but the script is giving me an error. "'main_pan' is an undeclared identifier."

Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1