Megaman X4 là một tựa game rất thú vị gắn bó với mình một thời gian dài qua điện tử bấm, khi mà máy tính hay lập trình còn là gì đó vô cùng xa vời. Mình còn nhớ nguyên mấy tháng mùa hè dí đầu dí cổ vào game để luyện tay qua màn, mãi mà không phá đảo được. Giờ để thử thách bản thân, mình đã tạo ra một giải pháp giúp mình chinh phục "giấc mơ tuổi thơ này". Đó chính là TOOL CHEAT GAME MEGAMAN X4. :v :v :v
Tuy nhiên, trước khi làm tool bạn cần có một giao diện đẹp "kinh khủng khiếp" để có thể xịn xò ngang với game. Chính vì vậy, để bổ trợ cho khóa học CHEAT GAME MEGAMAN X4, đồng thời củng cố khả năng lập trình giao diện với WPF. Kteam sẽ cùng bạn bắt đầuLập trình giao diện Megaman tool với WPF.
Ở bài trước mình đã hướng dẫn các bạn TẠO ANIMATION CHO "ONE HIT CREEP" BUTTON với Storyboard và Trigger. Ở bài này, Kteam sẽ cùng bạn tạo hiệu ứng cho button Full Life và tối ưu button "One Hit Creep".
Nội dung
Để theo dõi bài này một cách tốt nhất, bạn nên có kiến thức về:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace MegamanUI
{
///<summary>/// Interaction logic for App.xaml///</summary>publicpartialclass App : Application
{
}
}
<ResourceDictionaryxmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:local="clr-namespace:MegamanUI.XamlResources"><KeyTimex:Key="frame1">0:0:0.1</KeyTime><KeyTimex:Key="frame2">0:0:0.2</KeyTime><KeyTimex:Key="frame3">0:0:0.3</KeyTime><KeyTimex:Key="frame4">0:0:0.4</KeyTime><KeyTimex:Key="frame5">0:0:0.5</KeyTime><KeyTimex:Key="frame6">0:0:0.6</KeyTime><KeyTimex:Key="frame7">0:0:0.7</KeyTime><KeyTimex:Key="frame8">0:0:0.8</KeyTime><KeyTimex:Key="frame9">0:0:0.9</KeyTime><KeyTimex:Key="frame10">0:0:1</KeyTime><KeyTimex:Key="frame11">0:0:1.1</KeyTime><KeyTimex:Key="frame12">0:0:1.2</KeyTime><KeyTimex:Key="frame13">0:0:1.3</KeyTime><KeyTimex:Key="frame14">0:0:1.4</KeyTime><KeyTimex:Key="frame15">0:0:1.5</KeyTime><KeyTimex:Key="frame16">0:0:1.6</KeyTime><KeyTimex:Key="frame2s">0:0:2</KeyTime><Storyboardx:Key="createStoryStart"Storyboard.TargetProperty="(TextBlock.Text)"><StringAnimationUsingKeyFramesRepeatBehavior="Forever"><DiscreteStringKeyFrameValue="C"KeyTime="{StaticResource frame1}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="Cr"KeyTime="{StaticResource frame2}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="Cre"KeyTime="{StaticResource frame3}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="Crea"KeyTime="{StaticResource frame4}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="Creat"KeyTime="{StaticResource frame5}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="Create"KeyTime="{StaticResource frame6}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="Created"KeyTime="{StaticResource frame7}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="Created "KeyTime="{StaticResource frame8}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="Created b"KeyTime="{StaticResource frame9}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="Created by"KeyTime="{StaticResource frame10}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="Created by "KeyTime="{StaticResource frame11}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="Created by K"KeyTime="{StaticResource frame12}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="Created by K9"KeyTime="{StaticResource frame13}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="Created by K9"KeyTime="{StaticResource frame2s}"></DiscreteStringKeyFrame></StringAnimationUsingKeyFrames></Storyboard><Storyboardx:Key="oneHitStoryStart"Storyboard.TargetProperty="(TextBlock.Text)"><StringAnimationUsingKeyFrames><DiscreteStringKeyFrameValue="O"KeyTime="{StaticResource frame1}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="ON"KeyTime="{StaticResource frame2}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="ONE"KeyTime="{StaticResource frame3}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="ONE "KeyTime="{StaticResource frame4}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="ONE H"KeyTime="{StaticResource frame5}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="ONE HI"KeyTime="{StaticResource frame6}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="ONE HIT"KeyTime="{StaticResource frame7}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="ONE HIT "KeyTime="{StaticResource frame8}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="ONE HIT C"KeyTime="{StaticResource frame9}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="ONE HIT CR"KeyTime="{StaticResource frame10}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="ONE HIT CRE"KeyTime="{StaticResource frame11}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="ONE HIT CREE"KeyTime="{StaticResource frame12}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="ONE HIT CREEP"KeyTime="{StaticResource frame13}"></DiscreteStringKeyFrame></StringAnimationUsingKeyFrames></Storyboard><Storyboardx:Key="fullLifeStoryStart"Storyboard.TargetProperty="(TextBlock.Text)"><StringAnimationUsingKeyFrames><DiscreteStringKeyFrameValue="F"KeyTime="{StaticResource frame1}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="FU"KeyTime="{StaticResource frame2}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="FUL"KeyTime="{StaticResource frame3}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="FULL"KeyTime="{StaticResource frame4}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="FULL "KeyTime="{StaticResource frame5}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="FULL L"KeyTime="{StaticResource frame6}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="FULL LI"KeyTime="{StaticResource frame7}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="FULL LIF"KeyTime="{StaticResource frame8}"></DiscreteStringKeyFrame><DiscreteStringKeyFrameValue="FULL LIFE"KeyTime="{StaticResource frame9}"></DiscreteStringKeyFrame></StringAnimationUsingKeyFrames></Storyboard><Storyboardx:Key="fullLifeImageStoryStart"Storyboard.TargetProperty="(Image.Source)"><ObjectAnimationUsingKeyFrames><DiscreteObjectKeyFrameKeyTime="{StaticResource frame1}"><DiscreteObjectKeyFrame.Value><BitmapImageUriSource="../Images/FullLife/40%-FullLife-kteam.png"></BitmapImage></DiscreteObjectKeyFrame.Value></DiscreteObjectKeyFrame><DiscreteObjectKeyFrameKeyTime="{StaticResource frame2}"><DiscreteObjectKeyFrame.Value><BitmapImageUriSource="../Images/FullLife/50%-FullLife-kteam.png"></BitmapImage></DiscreteObjectKeyFrame.Value></DiscreteObjectKeyFrame><DiscreteObjectKeyFrameKeyTime="{StaticResource frame3}"><DiscreteObjectKeyFrame.Value><BitmapImageUriSource="../Images/FullLife/60%-FullLife-kteam.png"></BitmapImage></DiscreteObjectKeyFrame.Value></DiscreteObjectKeyFrame><DiscreteObjectKeyFrameKeyTime="{StaticResource frame4}"><DiscreteObjectKeyFrame.Value><BitmapImageUriSource="../Images/FullLife/70%-FullLife-kteam.png"></BitmapImage></DiscreteObjectKeyFrame.Value></DiscreteObjectKeyFrame><DiscreteObjectKeyFrameKeyTime="{StaticResource frame5}"><DiscreteObjectKeyFrame.Value><BitmapImageUriSource="../Images/FullLife/80%-FullLife-kteam.png"></BitmapImage></DiscreteObjectKeyFrame.Value></DiscreteObjectKeyFrame><DiscreteObjectKeyFrameKeyTime="{StaticResource frame6}"><DiscreteObjectKeyFrame.Value><BitmapImageUriSource="../Images/FullLife/90%-FullLife-kteam.png"></BitmapImage></DiscreteObjectKeyFrame.Value></DiscreteObjectKeyFrame><DiscreteObjectKeyFrameKeyTime="{StaticResource frame7}"><DiscreteObjectKeyFrame.Value><BitmapImageUriSource="../Images/FullLife/100%-FullLife-kteam.png"></BitmapImage></DiscreteObjectKeyFrame.Value></DiscreteObjectKeyFrame></ObjectAnimationUsingKeyFrames></Storyboard><Storyboardx:Key="fullLifeImageStoryEnd"Storyboard.TargetProperty="(Image.Source)"><ObjectAnimationUsingKeyFrames><DiscreteObjectKeyFrameKeyTime="{StaticResource frame8}"><DiscreteObjectKeyFrame.Value><BitmapImageUriSource="../Images/FullLife/0%-FullLife-kteam.png"></BitmapImage></DiscreteObjectKeyFrame.Value></DiscreteObjectKeyFrame><DiscreteObjectKeyFrameKeyTime="{StaticResource frame7}"><DiscreteObjectKeyFrame.Value><BitmapImageUriSource="../Images/FullLife/40%-FullLife-kteam.png"></BitmapImage></DiscreteObjectKeyFrame.Value></DiscreteObjectKeyFrame><DiscreteObjectKeyFrameKeyTime="{StaticResource frame6}"><DiscreteObjectKeyFrame.Value><BitmapImageUriSource="../Images/FullLife/50%-FullLife-kteam.png"></BitmapImage></DiscreteObjectKeyFrame.Value></DiscreteObjectKeyFrame><DiscreteObjectKeyFrameKeyTime="{StaticResource frame5}"><DiscreteObjectKeyFrame.Value><BitmapImageUriSource="../Images/FullLife/60%-FullLife-kteam.png"></BitmapImage></DiscreteObjectKeyFrame.Value></DiscreteObjectKeyFrame><DiscreteObjectKeyFrameKeyTime="{StaticResource frame4}"><DiscreteObjectKeyFrame.Value><BitmapImageUriSource="../Images/FullLife/70%-FullLife-kteam.png"></BitmapImage></DiscreteObjectKeyFrame.Value></DiscreteObjectKeyFrame><DiscreteObjectKeyFrameKeyTime="{StaticResource frame3}"><DiscreteObjectKeyFrame.Value><BitmapImageUriSource="../Images/FullLife/80%-FullLife-kteam.png"></BitmapImage></DiscreteObjectKeyFrame.Value></DiscreteObjectKeyFrame><DiscreteObjectKeyFrameKeyTime="{StaticResource frame2}"><DiscreteObjectKeyFrame.Value><BitmapImageUriSource="../Images/FullLife/90%-FullLife-kteam.png"></BitmapImage></DiscreteObjectKeyFrame.Value></DiscreteObjectKeyFrame></ObjectAnimationUsingKeyFrames></Storyboard></ResourceDictionary>
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
Assest file
Nhằm giúp bạn có thể trải nghiệm hiệu ứng tool một cách tốt nhất, và chủ động trong việc sử dụng source. Kteam hỗ trợ full source code và các file liên quan tại phần ASSEST bên dưới nhé
Trong file này có gì???
Đầu tiên bạn sẽ có 1 file chứa assest gồm âm thanh, font, hình ảnh và icon.
Tiếp theo là File build hoàn chỉnh để bạn dễ dàng tham khảo các hiệu ứng.
Project hoàn chỉnh để tham khảo
Một file game exe dành cho bạn nào chưa từng chơi game megaman có thể thử qua để thêm hứng thú.
Kết luận
Qua bài học này, bạn đã nắm được cách tạo animation cho Button Full Life, tối ưu button One Hit Creep, debug và fix bug
Trong bài sau, mình sẽ hướng dẫn các bạn TẠO BUTTON ONE HIT BOSS.
Cảm ơn các bạn đã theo dõi bài viết. Hãy để lại bình luận hoặc góp ý của mình để phát triển bài viết tốt hơn. Đừng quên “Luyện tập – Thử thách – Không ngại khó”.
Tải xuống
Tài liệu
Nhằm phục vụ mục đích học tập Offline của cộng đồng, Kteam hỗ trợ tính năng lưu trữ nội dung bài học Animation Full Life button dưới dạng file PDF trong link bên dưới.
Ngoài ra, bạn cũng có thể tìm thấy các tài liệu được đóng góp từ cộng đồng ở mục TÀI LIỆU trên thư viện Howkteam.com
Đừng quên like và share để ủng hộ Kteam và tác giả nhé!
Project
Nếu việc thực hành theo hướng dẫn không diễn ra suôn sẻ như mong muốn. Bạn cũng có thể tải xuống PROJECT THAM KHẢO ở link bên dưới!
Thảo luận
Nếu bạn có bất kỳ khó khăn hay thắc mắc gì về khóa học, đừng ngần ngại đặt câu hỏi trong phần bên dưới hoặc trong mục HỎI & ĐÁP trên thư viện Howkteam.com để nhận được sự hỗ trợ từ cộng đồng.
Với mong muốn mang đến kiến thức chất lượng, miễn phí cho mọi người, với tâm huyết phá bỏ rào cản kiến thức từ việc giáo dục thu phí. Tôi đã cùng đội ngũ Kteam đã lập nên trang website này để thế giới phẳng hơn.
Hãy cùng chúng tôi lan tỏa kiến thức đến cộng đồng!
Megaman X4 là một tựa game rất thú vị gắn bó với mình một thời gian dài qua điện tử bấm, khi mà máy tính hay lập trình còn là gì đó vô cùng xa vời. Mình còn nhớ nguyên mấy tháng mùa hè dí đầu dí cổ vào game để luyện tay qua màn, mãi mà không phá đảo được. Giờ để thử thách bản thân, mình đã tạo ra một giải pháp giúp mình chinh phục "giấc mơ tuổi thơ này". Đó chính là TOOL CHEAT GAME MEGAMAN X4. :v :v :v
Tuy nhiên, trước khi làm tool bạn cần có một giao diện đẹp "kinh khủng khiếp" để có thể xịn xò ngang với game. Chính vì vậy, để bổ trợ cho khóa họcCHEAT GAME MEGAMAN X4, đồng thời củng cố khả năng lập trình giao diện với WPF. Kteam sẽ cùng bạn bắt đầu Lập trình giao diện Megaman tool với WPF.