Is this a proper way of doing it?

Just started using Construct 2? Post your questions here

Post » Mon Apr 24, 2017 4:49 pm

I'm making a sidescrolling shooter.

I've made an object obj_Bullet (a square with collision) that I made invisible.
When I hit space I spawn the obj_Bullet
Now i've got 2 different bullet types as sprites that, depending on a Global variable, can change between spr_Bullet0 and spr_Bullet1
-> System: Create object spr_Bullet0 on layer 0 at (obj_Bullet.​ImagePointX(​0​), obj_Bullet.​ImagePointY(​0​))
I set the position of the bullet sprite to the bullet object
-> spr_Bullet0: Set position to obj_Bullet (image point 0)

So I create the Sprite on the bullet's positioning when firing. it works well.

The reasoning for making the square is to use it as a container of sorts so I can do what i need with the object but be flexible with the sprites inside.
I'm just not sure if this is the proper method and that maybe I'll run into issues later regarding performance?
In my design I have 7 different bullet types.
B
26
S
7
G
4
Posts: 204
Reputation: 4,783

Post » Mon Apr 24, 2017 7:46 pm

This is actually a good idea, especially as you can stretch out the invisible helper sprite to prevent high speed projectiles from clipping through walls. You can also create interesting effects on your sprite without affecting the hitbox/colissions.
Mistakes were made.
B
49
S
24
G
107
Posts: 1,581
Reputation: 60,303

Post » Tue Apr 25, 2017 4:46 pm

Thanks! I'll carry on then :)
B
26
S
7
G
4
Posts: 204
Reputation: 4,783


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest