Compare two pictures

Started by Lt. Smash, Mon 25/06/2007 14:45:40

Previous topic - Next topic

Lt. Smash

Hello everyone!

I have decided to make a little fungame with some puzzles like the one where you compare two pictures.

Now I wanted to know from you how to make that work.
Say I have one picture, a normal one, which I change to another one(the fault one) and save them as png. I import them as sprites(make dynamicsprites out of them?)and place them into the room.
Is it possible to code to find out where they aren't the same(fault) and when I click on the faults something happens?

I know that this is a bit to complex for a fungame; I could make hotspots or so; but I wanted to know how to do that, because that could  be maybe helpful for my 'normal' adventure game.

Thanks

DoorKnobHandle

What's the problem? Create two images, similar, but not the same, in a paint-program, put them into AGS, create hotspots on the right picture where you have those differences and then code the rest of the program (what happens when a user finds and clicks such a difference / maybe let AGS draw a circle around the difference etc).

Creating an algorithm to do that automatically for you is incredibly hard to impossible to program and even in the best case, heavily time-intense. Just do it by hand.

Ashen

If you've only got one set of pictures to compare, Hotspots are probably the way to go. If you were doing it multiple times, that'd need multiple rooms, and you might be better using arrays to store the positions of the differences, and checking mouse position relative to the Object. You'd have to enter positions for all 'faults' manually, which would be pretty time consuming, but it should work.

As for automating it ... Maybe you could use someting like SSH's RawGetRGB module to compare the two images under the mouse click - but you'd still need some way to stop the same difference being 'found' multiple times, and to track when they were all found, so it probably wouldn't save that much work.
I know what you're thinking ... Don't think that.

Lt. Smash

QuoteMaybe you could use someting like SSH's RawGetRGB module

Yes the RawGetRGB module was the thing I was missing in AGS. I will use this in my adventure game and for this 'mini'-game I will use 8 objects and a struct+array where I store their position for each 'level'.

R4L

Or, if you're letting the player click on whats different, why not make the different things into objects? Then they can have they're own animations.

SMF spam blocked by CleanTalk