-
Notifications
You must be signed in to change notification settings - Fork 25
/
GearJointDemo.cs
47 lines (34 loc) · 1.02 KB
/
GearJointDemo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System.Collections.Generic;
using DDW.Display;
using DDW.V2D;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Box2D.XNA;
using V2DRuntime.Attributes;
namespace V2DTest
{
public class GearJointDemo : V2DScreen
{
public Sprite bkg;
[PrismaticJointAttribute(enableMotor = true, maxMotorForce = 500, motorSpeed = 5)]
public PrismaticJoint pj;
public GearJointDemo(V2DContent v2dContent) : base(v2dContent) { }
public GearJointDemo(SymbolImport si) : base(si) { }
public override void Initialize()
{
base.Initialize();
}
public override void Update(GameTime gameTime)
{
base.Update(gameTime);
if (pj._limitState == LimitState.AtUpper)
{
pj.SetMotorSpeed(-5);
}
else if (pj._limitState == LimitState.AtLower)
{
pj.SetMotorSpeed(5);
}
}
}
}