0
Shapes_Init()
Shapes_Add()
While("True")
Shapes.Rotate(shp[3]["obj"],300) 
Shapes.Rotate(shp[4]["obj"],-300) 
Shapes.Rotate(shp[5]["obj"],90) 
Shapes.Rotate(shp[6]["obj"],90) 
Program.Delay(1000)
Shapes.Rotate(shp[3]["obj"],-300) 
Shapes.Rotate(shp[4]["obj"],300) 
Shapes.Rotate(shp[5]["obj"],180) 
Shapes.Rotate(shp[6]["obj"],180) 
Program.Delay(1000)
Shapes.Rotate(shp[3]["obj"],300) 
Shapes.Rotate(shp[4]["obj"],-300) 
Shapes.Rotate(shp[5]["obj"],90) 
Shapes.Rotate(shp[6]["obj"],90) 
endwhile

Sub Shapes_Init
  X0 = 10        ' x offset
  Y0 = 50       ' y offset

  shp[1] = "func=ell;x=60;y=-5;width=50;height=45;bc=#6A5ACD;" 
  shp[2] = "func=rect;x=40;y=42;width=100;height=150;bc=#6A5ACD;"      
  shp[3] = "func=rect;x=14;y=50;width=12;height=60;angle=35;bc=#6A5ACD;"  
  shp[4] = "func=rect;x=155;y=50;width=12;height=60;angle=-35;bc=#6A5ACD;"
  shp[5] = "func=rect;x=130;y=195;width=12;height=60;angle=180;bc=#6A5ACD;"
  shp[6] = "func=rect;x=40;y=195;width=12;height=60;angle=180;bc=#6A5ACD;"

EndSub

Sub Shapes_Add
  GraphicsWindow.Width=1200
  GraphicsWindow.Height=700
  For i = 1 To Array.GetItemCount(shp)
    GraphicsWindow.BrushColor = shp[i]["bc"]
    If shp[i]["func"] = "rect" Then
      shp[i]["obj"] = shapes.AddRectangle(shp[i]["width"], shp[i]["height"])
    ElseIf shp[i]["func"] = "ell" Then
      shp[i]["obj"] = shapes.AddEllipse(shp[i]["width"], shp[i]["height"])
    EndIf
    Shapes.Move(shp[i]["obj"], X0 + shp[i]["x"], Y0 + shp[i]["y"])
    If shp[i]["angle"] <> 0 Then
      Shapes.Rotate(shp[i]["obj"], shp[i]["angle"])
    EndIf
  EndFor
EndSub

试图在小基础上制作跳跃人的动画。刚刚想出了工作正常的工作。有没有其他更好的方法来实现这一点。每次他跳跃时我都需要改变颜色。这个怎么做?

4

1 回答 1

0

我会做的是使用 Litdev 扩展,可以在这里找到:http: //litdev.co.uk/

你可以用它做的是 LDShapes.AddAnimatedImage。这样您就可以添加这样的精灵表:http: //www.inkfood.com/wordprez/wp-content/uploads/SpriteSheet.png

这是它的样子:https ://www.youtube.com/watch?v=cqOayLccGXo&feature=youtu.be

这是实现这一点的代码:

LDShapes.AddAnimatedImage("C:/SpriteSheet.png","True",12,3)
于 2015-08-28T19:11:14.540 回答