Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by nholbert

I've got a fairly simple question but wasn't able to find an answer by searching the forum (might not have known the magic word...). Basically my issue is this: I want the user to be able to press a button and load up a new window/screen where they'll be able to manipulate some items/entities/whatever, and then close that window to return to the level.

I had planned on creating this new screen in weltmeister as a level (it will have entities and interactions between entities...not unlike a minigame) and then just loading it up when necessary. Of course, that resets the level the player is currently in, rather than sort of "pausing" it to be returned to later...

Thoughts on how to make a level within a level? or is there a better approach I'm missing?

1 decade ago by Xander

This seems like an unlikely thing for Impact to be able to do. It almost sounds like you are building a menu (which would require pausing, and such).

As it stands, I doubt you will be able to do this, but I'd love to know if it is possible.

1 decade ago by monkeyArms

To do it all in impact, you would need to create some sort of game state class, with which you could record the player position and anything else that changes within a level. Then when you reload the initial level and spawn all the entities, you can re-position anything that has moved using that information.

Vague answer, but hopefully you get the idea.

1 decade ago by nholbert

Thanks for the tips.

@Xander - Sounds like you have some idea what I'm thinking. I figured it would be a bit easier than I'm finding it to be. One option I considered was creating a second canvas on my html page and then dynamically changing the z-index when loading the menu window (if that's even possible...). I may give that a try and see how it works.

@monkeyArms - I was hoping to avoid that method but I have a feeling that's where this is going...

1 decade ago by Graphikos

It's entirely possible you just have be a bit more creative. Mostly you need to make use of draw() so you can overlay on top of the level. I guess you could also do like offscreen entities that you can move in that represent your menu or whatever (discussed here). I prefer draws though.

You could overlay standard HTML also... wouldn't have to be a second canvas. More info here: http://impactjs.com/forums/impact-engine/jquery-ui-and-impact.

1 decade ago by nholbert

@Graphikos
Unfortunately the HTML option won't really work for me as I'm not building a menu as much as a minigame that will have it's own rules/logic/interactions/etc. However the offscreen entity link you provided... I had seen it before but dismissed it. After checking out MikeH's game it looks pretty nice. Maybe I can mix some of his ideas about making the inventory an entity with spawning it on demand using draw()... You've given me a lot to think about! Thanks!
Page 1 of 1
« first « previous next › last »