How do I Spawn Different Backgrounds in One Layout?

Get help using Construct 2

Post » Fri Jul 01, 2016 11:22 pm

I'm working on an asteroids game (yes, another asteroids game) but i'd like to do things a bit different. Instead of having a single static background, i'd like to have several backgrounds to represent different parts of space. My problem is getting the players ship from background to background smoothly.

I thought about just scrolling the background in but that would look cheesey imo. Showing the ship in hyperspace may be a good idea, but don't know how to implement that.

Another idea would be to show a screen with certain statistics, like the time it took to pass the level, number of asteroids destroyed and times the player's ship was destroyed. I'd need lots of help with this, though, but then couldn't i just destroy that background and spawn the new one?

Any input on this would be greatly appreciated.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Sat Jul 02, 2016 1:12 am

Well I am unsure exactly how you have your game setup, or I can't really gather what you might have in your head, etc. But let's see...

If I was to do that, I might have one background with many animation frames of the different backgrounds I plan to use. Then maybe when it's time to transition to another background I might do a quick screen flash with sound effect, then have an event change the frame of animation, and then fade the flash to reveal that the background had changed.

It would be super simple, not take too much resource, and be effective enough to demonstrate a different phase to the player. All while staying in the same layout.

Could work?
B
13
S
4
G
3
Posts: 23
Reputation: 1,967

Post » Sat Jul 02, 2016 1:33 am

That might work. Thank you.

Basically think of the top down asteroids. There is blackness and nothing else.

In my game the 12 background scenes are created with different star patterns and different colors. I'd like to change the background to the different scenes as the game progresses to give a sense that the player is in a different part of space every 3 levels.

And if i understand correctly, you're saying import the 12 backgrounds like an animation, so each scene has a different frame number. Then just load that frame number after the "screen flash". Right?
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Sat Jul 02, 2016 3:12 am

You can do something like this in just about endless ways... you could have an unbounded scrolling layout that creates new "background" objects as you fly along (if you nicely parallax this it would look pretty neat).

I recently made an endless/unlimited map that generates tiles in any direction the player travels, starting from a central point (so it can go positive values as well as negative values on the "Grid") which you could also use for something similar.

Maybe a screen capture of my events for this will help;
Note there is a global variable called GridSize which I set to 64 in this case...
Image

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474

Post » Sat Jul 02, 2016 6:26 am

See my example for changing background in following topic:
viewtopic.php?f=146&t=171469&p=1031077&hilit=+moving#p1031077
ImageImage
B
108
S
49
G
23
Posts: 783
Reputation: 22,611

Post » Sat Jul 02, 2016 9:51 am

Personally, I would just set trigger boxes in the areas that need a bg change and use the Fade behavior to fade-in the new bg for that area.
B
55
S
28
G
107
Posts: 108
Reputation: 57,785

Post » Sat Jul 02, 2016 7:14 pm

Thank you all for the input.

My layout is 1280, 720 with a 960, 540 window size. It's a top down view of space, ship and asteroids. The BG is black with 2 layers of stars and the top layer is just a bit brighter than the bottom layer.

I think i will cut the star layers into 128 x 720 strips and once that "zone" is cleared, freeze the ship heading 90 degrees while playing the thrusters animation, randomly spawn and move the strips on their own layer from right to left.

Or something to that effect. Now, all i have to do is learn how the heck to do it.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107


Return to How do I....?

Who is online

Users browsing this forum: Ashley and 25 guests