Sprite Candy coders

Blitz3D Forums/Blitz3D Userlibs/Sprite Candy coders

Dr JoeByrd(Posted 2006) [#1]
Just got Sprite Candy and trying to get a few things to work. Like.....

Using one of the collision shape demo files as a starting point I put a piece of code together which I've been trying to make work for about 6 hours. I've created a template graphics that I want to use for critters in my game. It's based on a 96X96 frame. I have 2 rows of 9 frames so the png is 864X192. The first 8 frames of each row are a creature animation, one row for left and one row for right. The 9th frame in each row is the creature in a standing position facing left or right. When keys are pressed on the keyboard I'd like the animation to switch between left and right and when the key is released the creature should stop facing the correct direction. Here is the code I came up with which works as far as moving the animation but I can't get it to switch animations. Using the mirrorImage command I can get it to work the other direction but I had 2 different sides to the creature. I could probably do it with more HUDs/layers but since I'm likely to need a dozen or so of these creatures it would probably get really unwieldy. Here is the code I came up with. Could anyone familiar with Sprite Candy make any suggestions?
Thanks

joeb

Joe B
...
...
...
While Not KeyDown(1)

; MOVE WITH KEYS
If KeyDown(203) Then
If direction = "" or direction = "L" Then HUD_AnimateImage Figure, 0,0, 8, 8, "NORMAL", 0, 60
HUD_MoveObject Figure,-speed,0
; HUD_MirrorImage Figure, 1
HUD_PlayImageAnimations Figure
direction = "R"
End If
If KeyDown(205) Then
If direction = "" or direction = "R" Then HUD_AnimateImage Figure, 0,96, 8, 8, "NORMAL", 0, 60
HUD_MoveObject Figure, speed,0 :
; HUD_MirrorImage Figure, 0 :
HUD_PlayImageAnimations Figure
direction = "L"
End If
If KeyDown(203) = False And KeyDown(205) = False Then
If direction = "L" Then HUD_AnimateImage Figure, 768,96, 1, 1, "NORMAL", 0, 60
If direction = "R" Then HUD_AnimateImage Figure, 768,0, 1, 1, "NORMAL", 0, 60
HUD_PauseImageAnimations Figure
direction = ""
End If

; FALL DOWN
...
...
;End of When loop


IPete2(Posted 2006) [#2]
Dr,

You should send an email to Mike (the author) he's a very apporachable chap and will usually reply to emails same day.

You'll find the email address for him in the docs for Sprite Candy.

IPete2.