Image Manipulation

For questions about using Classic.

Post » Wed Feb 10, 2010 11:43 pm

The idea I want to play with right now is allowing the player to grab pieces of the scenery and move them around.

I know I could make the levels out of tiles and allow the player to grab those tiles, but I'm really going for a feeling of pulling a piece out of the screen. These pieces could include multiple objects, blank space, and even the background which scrolls at a different rate.

I'm thinking the game takes a small screenshot of a square in front of the player, and if at all possible, makes a kind of transparent hole in that spot.

Can it be done? At least the small image capture part?

And this might be way out there, but if there's any possible way to rearrange parts of the screen while keeping them animated, that would be amazing. Like if an enemy walked through the hole in the screen that was cut out, it would briefly show up in the block taken out of the scenery. Like looking through a window on one side of the screen that corresponds to another part of the screen.
B
2
G
2
Posts: 12
Reputation: 674

Post » Wed Feb 10, 2010 11:55 pm

You could do a few things with canvas, and the image manipulator object... the image grabbing part, yeah thats doable, as to those parts being animated, I think that would be a bit much.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Thu Feb 11, 2010 12:36 am

Oh wow, I hadn't experimented at all with the canvas object, I really didn't give it much thought. This seems to do exactly what I want as far as image grabbing goes. And it seems like it could do the animated thing too, if I just keep pasting something from a specific spot onto the canvas.

So I guess the only question I have left is about any way I could make holes in objects. It would have to be a method that lets the player move through the spots that were taken away. All my experiments with changing the solidity of objects while the game is running have run into brick walls so far.
B
2
G
2
Posts: 12
Reputation: 674

Post » Thu Feb 11, 2010 12:59 am

[quote="CPW":2mvplwe2]
So I guess the only question I have left is about any way I could make holes in objects. It would have to be a method that lets the player move through the spots that were taken away. All my experiments with changing the solidity of objects while the game is running have run into brick walls so far.[/quote:2mvplwe2]

-> Canvas: Update collision mask
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Thu Feb 11, 2010 1:35 am

This is kinda hurting my head.

I've been playing around with these canvases and the updating of the collision masks, but I can only get it to add solid parts to a canvas. Like if you copy a wall object into the canvas, it takes all of the wall in the area no matter what's in front. So I thought I could add a non-solid object to what the canvas copies from, but as long as there's some picture there, it makes it all solid. And if you copy transparency, you're copying nothing. So how do you add negative space to a canvas? Or to a sprite for that matter.

The other problem I'm having is copying the image all at once. For instance I'll have it set so that when the mouse is clicked, copy from object to canvas, copy from canvas to image manipulator, and then copy from image manipulator to sprite. The first click will copy the image to the canvas, and then the second click will update the canvas to the current image, and the previous image will go to the sprite. How do I go about updating it instantly?
B
2
G
2
Posts: 12
Reputation: 674

Post » Thu Feb 11, 2010 2:12 am

for punching holes in canvas, paste an object with the erase effect on it.
and, of course, then update the collision mask of canvas
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Feb 11, 2010 2:43 am

Perfect. The only problem I'm still having is copying the canvas to a sprite, but I'm sure I can figure that out. Edit: Yep, got it.

Wow, you guys knocked out my questions so quickly and effectively, thanks so much.

This program and this community make it so easy to do such complex things.
B
2
G
2
Posts: 12
Reputation: 674


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests