Discuss Scratch

SuperPancake64
Scratcher
22 posts

Clones in pairs

Hi! I don't post here often, but I've had this programming issue that's been a massive roadblock in my latest project. It goes like this– my game operates with a camera system where the gameplay is projected from a single screen and magnified to give the illusion of scrolling. this works by making clones of each sprite in the game, enlarging them, and adjusting their position according to the camera sprite. It's very robust, and allows for independent camera control, as well as camera scaling, and possibly even rotation. But the problem arises when I want to add in enemies. Each enemy must be comprised of two clones communicating a constant stream of information between each other, one in the real game world, and one in the camera projection. I'm not quite sure how to do this, and it's what caused me to stop working on this game for nearly a year. If anybody knows a solution or workaround to this dilemma, please let me know!

Image depicting the game world and camera projection:


Camera projection script:
Jlerpy
Scratcher
1000+ posts

Clones in pairs

I don't get why it needs clones?
AProductions
Scratcher
500+ posts

Clones in pairs

I'm unsure what your issue is regarding enemies, but the complication could be due to how you're building your game world. I would suggest looking into rebuilding your game using a tile map instead of attempting to reinvent the wheel with whatever it is you're doing.

What I have had experience in which sounds familiar to your issue, is that clones are limited in what they can do, so you might just need to create several enemy sprites instead.
SuperPancake64
Scratcher
22 posts

Clones in pairs

AProductions wrote:

I'm unsure what your issue is regarding enemies, but the complication could be due to how you're building your game world. I would suggest looking into rebuilding your game using a tile map instead of attempting to reinvent the wheel with whatever it is you're doing.

What I have had experience in which sounds familiar to your issue, is that clones are limited in what they can do, so you might just need to create several enemy sprites instead.

Alright, I can make several enemy sprites. A tile map wouldn't be super efficient for the type of game I'm making, because the levels are *supposed* to be small. It's kind of a Mario Bros style game, where you have to clear waves of enemies in a small stage. Aside from the aforementioned issue with enemies, this engine has been a total life-saver, it's incredibly easy to use.
SuperPancake64
Scratcher
22 posts

Clones in pairs

Jlerpy wrote:

I don't get why it needs clones?
To have multiple enemies onscreen from one sprite

Powered by DjangoBB