Cutting grass minigame: Dynamic Sprites?[SOLVED]

Started by Knox, Tue 30/10/2012 04:25:34

Previous topic - Next topic

Knox

I'm trying to code a mini-game where the main player cuts his lawn. I was thinking Id divide the room up into squares and place dynamic sprites with the uncut grass texture on them. When the player moves from one square to the next, I'd clear/delete the dynamic sprite to reveal the room's background underneath, which would have the cut grass texture.

Something like this: (Space Quest 5 waxing the floor -->skip to 5min)
http://www.youtube.com/watch?v=VPa2ax02FJA

Is that a good way to solve this? Or is there a better, more efficient/clever way?
--All that is necessary for evil to triumph is for good men to do nothing.

Crimson Wizard

If it is a texture, why not draw grass tiles right over room background and repaint the squares that were cut with "empty" tiles?
So you won't need dynamic sprite at all.

Khris

I'd use an Object, baseline 0 so it appears behind/underneath everything else.
That way one can paint magic pink / transparent rectangles on the single DynamicSprite used as object graphic and thus you don't have squares popping up but the lawn mower will actually "paint" cut grass which looks a lot nicer, just like in the youtube video.

Knox

Awesome, Im going to try those suggestions now :)

Thanks guys!
--All that is necessary for evil to triumph is for good men to do nothing.

Knox

Hi guys,

Ive got the art setup and was wondering what size for the tractor do you prefer? Also, in your opinion, should I go with a large scrollable background for the minigame of cutting grass, or stick to 1024x768? I was thinking of adding "hazards" like rocks, bottles, tree branches, etc...that the player has to avoid, if not the blades get jammed + motor chokes, hehe!

[img=http://s7.postimage.org/ly59dcwh3/screen1.jpg]
[img=http://s12.postimage.org/a974qllhl/screen2.jpg]
--All that is necessary for evil to triumph is for good men to do nothing.

Knox

#5
Ok, so Ive got it to work using draw line set to the proper thickness of where the mower blades are + magic pink. Now my next step is to use an "alpha" sprite "cutter" that cuts away the grass with jagged edges instead of the DrawLine function (cause right now it doesn't look realistic since it "cuts" in super straight edges)...I'll fiddle with Calin's "PutAlpha" in his AGSBlend plugin and see what I come up with.

In the meantime, I was wondering if this was possible below? While clearing the dynamic sprite away with magic pink, is it possible to also add a "shadow" underneath where the grass is cut, so it acts like the vid below in photoshop? I'm guessing I'd have to make a copy of what section of grass is being cut in the room's rep_exec, displace it downward, fill it with a dark green shadow color, blur it and then set the opacity to like 50%...then redraw the grass over that?

View My Video

--All that is necessary for evil to triumph is for good men to do nothing.

selmiak

Quote from: General_Knox on Wed 21/11/2012 06:22:22
In the meantime, I was wondering if this was possible below? While clearing the dynamic sprite away with magic pink, is it possible to also add a "shadow" underneath where the grass is cut, so it acts like the vid below in photoshop? I'm guessing I'd have to make a copy of what section of grass is being cut in the room's rep_exec, displace it downward, fill it with a dark green shadow color, blur it and then set the opacity to like 50%...then redraw the grass over that?
When you get the blurred cut gras with no sharp edges done, just have another layer under the gras with the shadow color and cut out from that layer what you cut out from the gras layer (and a bit displaced like a shadow would fall)...?

Knox

#7
Cool, thats exactly what I chose to do, it works! Only thing left to do now is find a way to make the "alpha sprite" version run faster. The "Draw" way with magic pink works nice and fast now.

ps: I can post the results if anyone wishes!
--All that is necessary for evil to triumph is for good men to do nothing.

SMF spam blocked by CleanTalk