construct game from several caps?

For questions about using Classic.

Post » Sat Sep 17, 2011 9:07 pm

Is it possible to create a game by creating each level in a different .cap file and then calling a new cap file at the end of each level?
I'm asking this because construct tends to become slow and crash-prone when a single .cap file grows larger and I have a game idea that would involve a lot of levels with a lot of graphics.
B
3
S
1
G
3
Posts: 45
Reputation: 1,140

Post » Sat Sep 17, 2011 9:11 pm

No, and don't try to copy stuff between .caps! It's an unfinished feature and can mess up your .cap.

A way to speed things up though is to keep large graphics external and load them at runtime with the sprite's 'load frame from file' action.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Sat Sep 17, 2011 10:18 pm

[QUOTE=Arima]
A way to speed things up though is to keep large graphics external and load them at runtime with the sprite's 'load frame from file' action.[/QUOTE]

im curious... could you please give me some kind of a simple example?
i mean how would i do something like that at runtime?
ive been thinking of umm, how do you call it.. "streaming" levels or sections of levels to save some precious resources but i just cant wrap my head around it.
B
4
S
2
G
2
Posts: 109
Reputation: 1,318

Post » Mon Sep 19, 2011 2:40 pm

Here is an example cap of how to load a sprite at runtime.

LoadFrameFromFile
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Fri Sep 23, 2011 5:34 am

Okay, so I managed to make this work somehow. It's messy, and it's probably not very orthodox but it does work.
Basically you have to create an executable for each of your levels and or menus.
then when you want to switch levels, you launch the new executable (by using the 'File' object) and close the current one (to avoid construct throwing a DX9 error) with system->close.
If you want to share data between levels (such as scores, lives, passwords, etc...) you can save it in a temp file like a hashtable.

I suppose there might be problems such as memory consumption, but it's useable , I tested it heavily.declan_gage2011-10-28 04:33:04
B
3
S
1
G
3
Posts: 45
Reputation: 1,140


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests