跳跃人-小基础

  • 本文关键字:跳跃 smallbasic
  • 更新时间 :
  • 英文 :

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

试图想出一个跳跃的人在小基础的动画。我只是想出了一些可行的方法。还有其他更好的方法吗?我还需要在他每次跳跃时改变颜色。如何做到这一点?

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

你可以做的是ldshape . addanimateimage。这样你就可以像这样添加一个精灵表: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)

相关内容

  • 没有找到相关文章

最新更新