Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 23 additions & 3 deletions CMPUT 250 W24 Lab 3/Assets/DVDLogo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

public class DVDLogo : MonoBehaviour
{
public List<Sprite> DefaultAnimationCycle;
public SpriteRenderer spriteR;

public float Framerate = 12f;//frames per second

//private animation stuff
private float animationTimer;//current number of seconds since last animation frame update
private float animationTimerMax;//max number of seconds for each frame, defined by Framerate

//Speed it moves at
public float speed = 3;

Expand All @@ -12,13 +21,20 @@ public class DVDLogo : MonoBehaviour

//Current direction
private Vector3 direction;


protected void AnimationSetup(){
animationTimerMax = 1.0f/((float)(Framerate));
}

// Start is called before the first frame update
void Start()
void Start(){
{
//Randomly initialize direction
direction = new Vector3(Random.Range(-1f,1f), Random.Range(-1f,1f));
direction.Normalize();
AnimationSetup();
spriteR = GetComponent<SpriteRenderer>();
}

}

Expand Down Expand Up @@ -60,5 +76,9 @@ void Update()
}

transform.position += direction*Time.deltaTime*speed;
speed += 1;
if(speed == 75){speed = 0;}
}
}


}
24 changes: 16 additions & 8 deletions CMPUT 250 W24 Lab 3/Assets/Scenes/SampleScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,15 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3df35848a1b344bd5a1923d962ae8b19, type: 3}
m_Name:
m_EditorClassIdentifier:
speed: 3
X_Max: 5
DefaultAnimationCycle:
- {fileID: 3893449091656718276, guid: 0b4592644780ac043ab58a8aa02def86, type: 3}
- {fileID: 2912813676682855716, guid: 0b4592644780ac043ab58a8aa02def86, type: 3}
- {fileID: 192882585686677951, guid: 0b4592644780ac043ab58a8aa02def86, type: 3}
- {fileID: -2431997244919056597, guid: 0b4592644780ac043ab58a8aa02def86, type: 3}
spriteR: {fileID: 755472559}
Framerate: 12
speed: 7
X_Max: 5.6
Y_Max: 4
--- !u!1 &519420028
GameObject:
Expand Down Expand Up @@ -321,7 +328,8 @@ SpriteRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 6e7069a7db07f489a87c0797b3ff2165, type: 3}
m_Sprite: {fileID: 3893449091656718276, guid: 0b4592644780ac043ab58a8aa02def86,
type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
Expand Down Expand Up @@ -555,18 +563,18 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 50
m_FontStyle: 0
m_FontSize: 75
m_FontStyle: 1
m_BestFit: 0
m_MinSize: 5
m_MaxSize: 50
m_Alignment: 0
m_MaxSize: 75
m_Alignment: 1
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: This is a bouncing ball
m_Text: Slime Time
--- !u!222 &2098954804
CanvasRenderer:
m_ObjectHideFlags: 0
Expand Down
Binary file added CMPUT 250 W24 Lab 3/Assets/Slime2_Attack_body.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading