Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Create a negative colored equivalent of an image  (Read 1273 times)

0 Members and 1 Guest are viewing this topic.
Create a negative colored equivalent of an image
« on: June 05, 2009, 08:41:30 pm »
  • *
  • Reputation: +16/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1633
You know how in alttp the enemies briefly changes colors when they get hit. I'm looking to create a similar effect. Meaning I want the player to see a change in the colors of mu enemy. I'm thinking of three solutions to do this, but none of these is very appealing so I want to use this topic to check if anybody has other options or experience with a similar situation. A little random brainstorming is also always welcome. XD

Option A: Change the sprite of the enemies object to an negative image of itself.
Problem: Can't find any such function so I'm guessing it doesn't exist with gamemaker (yet).

Option B: Use blending to change the enemies sprite.
Problem: Uh, sounds possible but I have no idea how to go about doing this (color-wise). Anybody have any experience with something like this?

Option C: Create separate sprites and simply switch the enemy sprite to one of those.
Problem: It will most defiantly work but it'll take more resources to do it. I also consider it sloppy programming. Every enemy getting hit will have multiple images to change into depending on things like status and facing direction. It will possible also need to be in a couple of colors so that's a lot of extra resources if your talking about a decent to large game. Needless to say any programming solution is far more appealing. Let's call option c the fall-back plan for now.
Logged
Re: Create a negative colored equivalent of an i...
« Reply #1 on: June 05, 2009, 09:13:37 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Posts: 728
Well, if it works like normal graphics APIs you can just use blending.

draw_set_blend_mode_ext(bm_inv_dest_color, bm_inv_src_color)

that's inverse blending.
Logged
  • Pyxosoft
Re: Create a negative colored equivalent of an i...
« Reply #2 on: June 06, 2009, 06:10:14 am »
  • *
  • Reputation: +16/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1633
Jup, that's what I was looking for. Thanks.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.523 seconds with 40 queries.