Académique Documents
Professionnel Documents
Culture Documents
An undergraduate Thesis
Presented to the College of Computer Studies
AMA COMPUTER COLLEGE – CALAMBA CAMPUS
In Partial Fulfillment
of the requirements for the degree of Bachelor of
Science in Information Technology
Erickarlo C. Tamayo
Archie M. Paglinawan
Sandy S. Catindig
April 2018
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY ii
ABSTRACT
and sometimes used as an educational tool. Games are distinct from work,
which is usually carried out for remuneration, and form art, which is more
improving skills, this game will help pupils to enhance their thinking skills
specially in math. This game also helps their strategic skills in solving
mathematics. This is the reason why proponents build this educational math
teaching way of learning and to entertain elementary pupils and also to gain
knowledge.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY v
ACKNOWLEDGEMENT
appreciation to the people who have extended their patience, talents, ideas
Rosenda A. CpE, MSCpE, Engr. Jose Ian Magdaug, ECE, Mr. Edelberto
And above all, to Lord Almighty for the courage and strength.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY vi
DEDICATION
This thesis is dedicated to Our God Almighty our Creator, our strong
and who taught us the purpose of life. He has been the source of our
strength throughout this program. We also dedicate this work to our family
TABLE OF CONTENTS
PAGE
TITLE i
ABSTRACT iii
ACKNOWLEDGEMENT v
DEDICATION vi
LIST OF TABLES x
LIST OF FIGURES xi
Foreign Studies 14
Local Literature 18
Local Studies 21
Synthesis 26
Summary 58
Conclusions 60
Recommendations 61
BIBLIOGRAPHY 62
APPENDICES 65
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY x
LIST OF TABLES
LIST OF FIGURES
LIST OF APPENDICES
Appendix Page
B Story board 65
C User manual 68
D Program listing 74
E Survey 89
F Curriculum Vitae 90
G Final Permit 91
H COR (Photocopy) 92
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 1
CHAPTER I
Introduction
in yesterday's skills. Nor should teachers be denied the tools that other
the way we teach and learn across the board. It can raise standards, and
lecturers, but alongside existing methods it can enhance the quality and
reach of their teaching, and reduce the time spent on administration. It can
enable every learner to achieve his or her potential, and help to build an
the way we teach and learn across the board. It can raise standards, and
lecturers, but alongside existing methods it can enhance the quality and
reach of their teaching, and reduce the time spent on administration. It can
enable every learner to achieve his or her potential, and help to build an
ambitious education system for a future learning society. One good example
multiplication.
Today‘s generation, both young and old people are being attracted by
games. But most games that are available on the market are not educational
or do not focus on sharpening one‘s mind. Games and apps that are
helped the users learn more effectively as can be seen by the feedback and
Jameson (2014). That is why the proponents would like to introduce their
own educational game to help pupils learn mathematics in a fun and game-
the world, some of these schools used quiz games in their classes or for the
pupils; homework to make learning more fun and engaging. The researchers
of the system would like to implement Battle Mathika in math classes to help
There are games, in the estimation, that can be used for educational
learning game based on mathematics, pupils and others that are in need of
basic knowledge in math or need to brush up owned basic math skills. The
game helps its users practice their math skills by challenging them to clear
stages in the game that will prompt them to solve basic math problems while
trying to react to the stages‘ surroundings and obstacles and in the process
make solving basic math problems more easy and natural for them. Although
graduates or people who are out of school to practice their basic math skills.
computing. That is why it is important to insert computing drills into the earlier
The proposed system, Battle Mathika was chosen and deemed highly
enjoyability.
mathematical problems
elementary schools.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 5
At the end of the study the researchers would like to answer the
improvement?
4. How will the proposed e-learning game help the player appreciate
Most of the pupils are having great difficulty with the math subjects
to appreciate numbers, take math subjects seriously and not to get bored
and not to skip the math subjects. Battle Mathika will help pupils sharpen the
minds and solve the math problems faster especially the basics.
Math tends to be the main factor of which how pupils choose their
courses in life, some will try even though they lack mathematical skills, some
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 6
are scared of even trying and thus not giving them chance to polish their
The main goal of the proposed system is to help pupils realize that
math is not all that hard and to stop their fear of math-related subjects and in
doing so makes computer courses that have math related subjects more
accessible and more pupils will pick up the study without the fear or hardship
of math subjects.
difficulty with math to build the basic foundations in mathematics and in turn
experience while also being familiarized with some of the greatest scientists
problems, the scoring system in the game will measure how proficient a pupil
is in solving basic math problems, and the game will include a leaderboard
and a scoreboard so that pupils can easily see their scores and have a
foundations of mathematics and does not provide drills for more advanced
math concepts. Fourthly, strictly for Android users, IOS is not yet supported
narrative, that it only focuses on the core gameplay and mathematical skills.
Hypothesis
pupils will have a better foundation for math and its related subjects which in
turn make appreciate the vast applications of mathematics in the world and
playing it and all pupils have their own handheld devices to use it, then math
class exercises will become more interesting and fun for the pupils and help
mathematics.
H0 – The proposed math game of the proponents did not significantly help
Definition of Terms
A. Operational Terms
component of the educational environment. While this can refer to the use of
or not, serve as specific media to implement the learning process. The term
worldwide.
B. Technical Terms
consolidated into a common pool that provides data for one or more multiple
uses. One way of classifying databases involves the type of content, for
GUI (Graphical User Interface), is a type of user interface item that allows
Software is a general term primarily used for digitally stored data such as
computers.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 10
occurs.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 11
CHAPTER II
This chapter shows the narrative literature, both foreign and in local
and the related studies. It includes here the difference and similarities
Foreign Literatures
benefit all pupils, especially those with the greatest need. In a survey by the
Joan Ganz Cooney Center(2014), teachers reported that pupils that were
Learning: What it is, Why it Works, and Where it's Going: ―Learning‖ doesn‘t
the players of the game work toward a goal, experience the consequences
along the way. The players make mistakes in a risk-free setting, and through
them is part of the learning process which is one of the reasons that game-
which is not a ―risk-free setting‖ where normally each the mistake that a pupil
training may fall short compared to game-based learning is the fact that it
procedures, then evaluate them on their memory of what they are told rather
way.
pressure from increasing tuition costs and free, online course offerings is
single course on the topic of games and their significance would have been
hard to find at most universities, much less an entire series of courses. Now,
own. While many courses and programs are focused on training professional
our games for impact certificate. We give pupils the opportunity to examine,
for example, the role of culture in shaping games and gameplay, or how
particular game mechanics support player learning. But we also use games
to introduce pupils with larger concepts and ideas; for example, we use
games to illustrate principles of learning and how games can serve as hubs
Foreign Studies
urged some schools around the world to try this new style of teaching. Some
teachers used websites online to help them motivate their pupils to study and
appreciate learning and studying more. One website has been very influential
to the spread of e-learning and the concept of gamifying the learning process
is Khan Academy. Khan Academy has reported in their studies from different
schools that have used their website that pupils have shown more interest in
learning their lesson. Pupils were more engaged because the exercises have
the game feel to it and give them points or badges for their accomplishments.
This one of the very reasons why game-based learning is so effective across
different studies. Pupils like to get constant feedback on their progress just
like they do when they play video games. It gives them a feel of where they
would want to focus their efforts on. Giving points or badges for doing
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 15
exercises give pupils motivation to study because it gives them incentives for
their hard work. In general, e-learning has shown a lot of promise in different
trial.
Gives pupils fun mini goals that can serve to sharpen their skills.
learning has made impressive advances in the past five years. Second,
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 16
internationalization of education.
could be a prime tool for new and better forms of international education. Our
or good practices that would confirm our assumption. Our final goal was to
them and their teachers. A professor in the education system can address
each of them individually. Those who study in this way can benefit from
directly. We can say that within distance education, the role of the human
tools on the results of pupils at the test. They showed how e-learning tools
impact pupils‘ achievement. The study was attended by nearly 2000 pupils.
The study compares the results of questions from the area of law where the
tool was provided in a pilot version with the results of questions, where the e-
learning tool was not provided. The researchers found that the e-learning
tools have affected the pupils‘ results. Nevertheless, the belief of the e-
learning tool may possibly have a negative effect on pupils who will depend
approach which can be used for enterprise resource planning (ERP) system.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 18
researchers found that the m-learning system was correlated positively for
other studies which stressed the importance of the quality of course content
Local Literatures
Inc. will continue to join hands with the Department of Education (DepEd) this
year in implementing the e-learning project where each teacher and pupil has
its own computer. Intel Microelectronics Philippines Inc. and DepEd‘s will to
support e-learning is a good indication that e-learning can help schools in the
DepEd during a pressed state, the optimal ratio for e-learning model is 1:1.
This can be accomplished by easily if each pupil in a school had their own
easily provide learners a 1:1 the ratio in their learning experience. Software
such as an educational game can now be used to give pupils drill while their
teachers can intervene and help pupils who are struggling with their learning.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 19
something unique inside the classroom. One unique learning strategy with
games. Games seem to be engaging, if not addictive. How can games help
how systems work while probing concepts in the sciences and the arts. A
game, after all, should make sense, and, at the same time, should be
appealing to the senses. Imagining a game paves the way to anticipating and
gateway for most children to digital literacy. Designing a game truly takes
technology into a classroom far beyond merely gluing a kid's eyes and
fingers to a screen.
technological age, science subdues and even drives societies with its ideas
and products and it is very likely that the impact of science and technology
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 20
on people‘s lives will persist to exist and increase in the coming years.
Through science, the way people think shifts to a more critical approach.
probably why many countries have embedded the very sense of science in
includes numerous types of media that deliver text, audio, images, and
with other literature from other countries which also support the
Local Studies
One of the sources that can verify the effectivity of e-learning are
Peter (2012) is a teacher that supports e-learning and started teaching his
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 22
pupils both Filipinos and Americans by recording his lectures in video and
indicate that it is working for them and that they are learning more. Their
classes.
their human resource development system. Take into account the experience
training in any area of the business they had interest in and blending e-
learning with hands-on projects. PLDT estimated that this kind of ―e-cross
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 23
training has saved the company over US$400,000 in training expenses over
data analysis showed that, apart from facilitating conditions, all other
Ibanez, Mavis Joy C. and Rendon, Hazel May V. (2013), the study intended
Technology for Thompson Christian School to cater the needs of the pupils
by providing screen share during discussions. The proponents used the Web
Engineering process model throughout the study. The proponents did some
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 24
The E-Learning will be working with the Screen Share during class hours.
ensures quality education for the pupils and for quality teaching of the
teachers. Modules are given and are very useful for the pupils and of the
teachers. The computation of the cost and benefit analysis are also provided
for the school to implement the system. The development of this system had
gone to different processes and circumstances. This system ensures that the
lieu of this, the proponents recommended that the company will have a faster
internet connection and a person who will maintain or observe the system for
phone is being used to bridge the digital divide and make the digitally
excluded sectors of the Filipino society become part of the online learning
Synthesis
The gathered studies and literature of both foreign and local literature
both focus on the benefits and potential of using technology to enhance the
pupil because they do not see it as tedious and looks at e-learning as like
that of a game and they show more interest in learning using technology than
transferred and shared, giving more flexibility in studies and more advanced
concepts can be tackled sooner because the pupil has access on the
the ability to save and store documents safely without ever decaying like
Hence, with the advent of today‘s technology, a great deal can now be
CHAPTER III
RESEARCH METHODOLOGY
Research Design
Research Locale
School. Since the school accepted that the study appropriates led in whole
organization and pupil of the school with the capacities to answer the
directed survey. Since the population of the school is over a thousand pupils,
the proponents will have a hundred pupils answer the survey conducted and
Conceptual Framework
framework of Battle Mathika explains the flow of the game, that is how a
player of the game would progress while they are playing and how the
system can help the player know which math skills they need to focus and
improve.
math skills. First the player would select a character to use and the game will
start. During playing the game the player will start encountering enemies
which will prompt the player to answer simple math problems, each correct
answer will allow the player to deal damage and defeat each enemy he may
encounter and earn points during the process. The player will be able to
proceed to the next stage in the game once he reaches the end of the
present stage and the whole process will repeat for the next until the final
Figure 1.2 explains the input and output of the system while Figure 1.1
explains the process and game flow of the proposed e-learning game. The
input of the system is the amount of time it takes a user to clear a stage and
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 31
the users score on given math problems which indicate their level of
will include information about the areas the user needs to focus and improve
on.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 32
System Architecture
Figure 1.3 shows from the user to hardware and software and vice
versa. The user to mobile runs on android where the application will be
installed accordingly.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 33
Context Diagram
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 34
“Stage Selection”
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 37
“Leaderboard”
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 38
“Character Selection”
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 39
Gantt Chart
The Gantt Chart helped the proponents in planning ahead towards the
The position, length, and color of the bar reflect to the start date, duration
Research Instrument
recover the data in a fast and proficient path from the respondents.
the system testing to monitor if the users are comfortable with the
Software Methodology
Refining User
Deployment Evaluation
Prototype
School to be the respondents of the study that composed of four (4) pupils
responsible for the testing and evaluation of the proposed system based on
the provided criteria by the proponents to achieve the objectives of the study.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 44
Sampling Design
The proponents used survey sampling using a Likert scale with the
help of a survey of the users that can be used by the proponents for the
determine the possible errors of the proposed system. This process will
Statistical Treatment
the Likert scale system to measure the collected information gathered from
For this study, the proponents will use Likert Scale as the statistical
Disagree (1), Disagree (2), Agree (3) and Strongly Agree (4). The proponents
Formula:
Where:
1. Weighted Mean
Formula:
∑
Where:
WM = weighted mean n = total number of respondents
W = weighted factor ∑ = summation
value of eacf facror
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 46
CHAPTER IV
Data Analysis
and/or logical techniques to describe and illustrate, condense and recap, and
evaluate data.
The total respondents of the survey are 100. The table below shows
Legend:
3 2.51-3.25 Agree
2 1.76-2.50 Disagree
(Strongly Agree). The weighted mean is 3.54. The interpretation result of the
(Agree). The weighted mean is 3.45. The interpretation result of the data is
Strongly Agree.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 51
(Agree). The weighted mean is 3.37. The interpretation result of the data is
Strongly Agree.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 52
(Agree). The weighted mean is 3.45. The interpretation result of the data is
Strongly Agree.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 53
The weighted mean is 3.32. The interpretation result of the data is Strongly
Agree.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 54
(Agree). The weighted mean is 3.32. The interpretation result of the data is
Strongly Agree.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 55
The weighted mean is 3.47. The interpretation result of the data is Strongly
Agree.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 56
(Agree). The weighted mean is 3.56. The interpretation result of the data is
Strongly Agree.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 57
about the proposed system. The weighted means of each criterion shows
that the proposed software performs on the excellent rate with a 3.435
weighted mean, the interpretation result of the data is Strongly Agree and
proving that it is a good idea and concept for the teachers and pupils of
CHAPTER V
Summary
exercises and skills. The proponents‘ system Battle Mathika strives to make
implementing the proposed software gave the following validity in terms of:
Table 4.1 with a weighted mean of 3.54 shows that the respondents
personally enjoyed playing the proposed system. This means that the
Table 4.2 with a weighted mean of 3.32 shows that the respondents
agree that implementation of the proposed system will help the class enjoy
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 59
studying math. This means that the proposed system makes practicing and
Table 4.3 with a weighted mean of 3.45 shows that the proposed
system helped the respondents improve their problem solving skills. This
means that the proposed game application is good for the curriculum of the
pupil.
Table 4.4 with a weighted mean of 3.37 shows that the proposed
This means that the proposed system improved the respondents‘ solving
Table 4.5 with a weighted mean of 3.37 shows that the proposed
system is effective on practicing math concepts for the pupil. This means that
incorporating the proposed system will help the respondents to polish their
Table 4.6 with a weighted mean of 3.47 shows that the game provides
system is a good learning tool for the pupils especially for math.
Table 4.7 with a weighted mean of 3.45 shows that the proposed game
means that the proposed game application can reduce the discomfort of
Table 4.8 with a weighted mean of 3.32 shows that the respondents
This means that the proposed system is suitable to be part of the curriculum
Table 4.9 with a weighted mean of 3.435 shows that the respondents
acknowledge the advantages the proposed system offers. This means that
Conclusion
can really help pupils to be more engaged in practicing their math skills and
elementary math studies, improving the speed of which the pupils solve math
into our daily lives. It is also verified that using Battle Mathika provides pupils
with sufficient amount of exercises to help them practice their math skills.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 61
Recommendation
For the future researchers who will conduct the same field of study, the
BIBLIOGRAPHY
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 63
Bibliographies
Frencken, H., Jacobi, R., & Jager, K. (2012). European education today.
Eric.ed.gov.
Moravec et al. (2015). The influence of using e-learning tools on the results
of pupils at the tests. sciencedirect.com.
(Feb. 20, 2013). Teachers Should Be Seen and Heard. Philippine Basic
Education. philippinesbasiceducation.us.
Arimbuyutan, R.C., Kim, S., Song, J. et al. (2014). study on e-Learning for
Philippines. sersc.org.
APPENDICES
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 66
APPENDIX B : Storyboard
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 68
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 69
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 70
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 71
You can start the game by pressing the ―Play‖ button, see the high scores
using the ―High Score‖ button, select the stage which you wanna start in
usiing the ―Select Stage‖ button, View the instruction manual within the game
using the ―Help Guide‖ or exit the application by tapping the right button on
If you tapped the high score button from the main menu or from the final
score panel, you can see the high scores from the different players in the
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 73
Leader Board. The Leader Board is updated online each time a new high
score is recorded.
If you tapped the Select Stage button from the main menu you are presented
the options to select the stages 1,2,3 or return back to the Main menu using
If you tapped the Help Guide button, you are redirected to the instructions
manual on how the various buttons within the game by using the Next and
Return button to view each tutorial image and using return or main menu
If you tapped the play button from the main menu, the character selection will
appear and you can select which character you would like to use to play the
game.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 76
Once the game has started, you can move around by tapping the left or right
arrow buttons on the bottom left of your screen to move towards the desired
direction on. To jump over obstacles, tap the circular button on the bottom
right of the screen. If a monster appears, you can attack it by answering the
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 77
math problem by tapping the right answer in the choices given also at the
Once you complete stages or your lives run out, you will go to the registration
After registering, you will go to the Final Score Panel where you can choose
to visit the Leader Board, Retry playing the game, and or go back to the main
menu.
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 79
//Controller 2D
wall climb jump of player, and other separate codes controlling other 2D
using UnityEngine;
using System.Collections;
[HideInInspector]
base.Start ();
collisions.faceDir = 1;
standingOnPlatform = false) {
UpdateRaycastOrigins ();
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 81
collisions.Reset ();
collisions.moveAmountOld = moveAmount;
playerInput = input;
if (moveAmount.y < 0) {
DescendSlope(ref moveAmount);
if (moveAmount.x != 0) {
collisions.faceDir = (int)Mathf.Sign(moveAmount.x);
if (moveAmount.y != 0) {
transform.Translate (moveAmount);
if (standingOnPlatform) {
collisions.below = true;
}
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 82
rayLength = 2*skinWidth;
1)?raycastOrigins.bottomLeft:raycastOrigins.bottomRight;
Debug.DrawRay(rayOrigin, Vector2.right *
directionX,Color.red);
if (hit) {
if (hit.distance == 0) {
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 83
continue;
Vector2.up);
if (collisions.descendingSlope) {
collisions.descendingSlope = false;
moveAmount =
collisions.moveAmountOld;
float distanceToSlopeStart = 0;
if (slopeAngle != collisions.slopeAngleOld) {
distanceToSlopeStart = hit.distance-skinWidth;
moveAmount.x -= distanceToSlopeStart *
directionX;
hit.normal);
moveAmount.x += distanceToSlopeStart *
directionX;
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 84
maxSlopeAngle) {
* directionX;
rayLength = hit.distance;
if (collisions.climbingSlope) {
moveAmount.y =
Mathf.Tan(collisions.slopeAngle * Mathf.Deg2Rad) *
Mathf.Abs(moveAmount.x);
collisions.right = directionX == 1;
1)?raycastOrigins.bottomLeft:raycastOrigins.topLeft;
moveAmount.x);
Debug.DrawRay(rayOrigin, Vector2.up *
directionY,Color.red);
if (hit) {
if (hit.collider.tag == "Through") {
if (directionY == 1 || hit.distance == 0) {
continue;
if (collisions.fallingThroughPlatform) {
continue;
if (playerInput.y == -1) {
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 86
collisions.fallingThroughPlatform =
true;
Invoke("ResetFallingThroughPlatform",.5f);
continue;
directionY;
rayLength = hit.distance;
if (collisions.climbingSlope) {
moveAmount.x = moveAmount.y /
Mathf.Tan(collisions.slopeAngle * Mathf.Deg2Rad) *
Mathf.Sign(moveAmount.x);
collisions.above = directionY == 1;
}
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 87
if (collisions.climbingSlope) {
1)?raycastOrigins.bottomLeft:raycastOrigins.bottomRight) + Vector2.up *
moveAmount.y;
RaycastHit2D hit =
Physics2D.Raycast(rayOrigin,Vector2.right *
directionX,rayLength,collisionMask);
if (hit) {
float slopeAngle =
Vector2.Angle(hit.normal,Vector2.up);
if (slopeAngle != collisions.slopeAngle) {
* directionX;
collisions.slopeAngle = slopeAngle;
collisions.slopeNormal = hit.normal;
}
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 88
slopeNormal) {
Mathf.Deg2Rad) * moveDistance;
moveAmount.y = climbmoveAmountY;
collisions.below = true;
collisions.climbingSlope = true;
collisions.slopeAngle = slopeAngle;
collisions.slopeNormal = slopeNormal;
skinWidth, collisionMask);
skinWidth, collisionMask);
if (maxSlopeHitLeft ^ maxSlopeHitRight) {
moveAmount);
moveAmount);
if (!collisions.slidingDownMaxSlope) {
raycastOrigins.bottomRight : raycastOrigins.bottomLeft;
if (hit) {
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 90
Vector2.up);
maxSlopeAngle) {
float moveDistance =
Mathf.Abs (moveAmount.x);
float descendmoveAmountY
moveAmount.x = Mathf.Cos
(moveAmount.x);
moveAmount.y -= descendmoveAmountY;
collisions.slopeAngle = slopeAngle;
collisions.descendingSlope = true;
collisions.below = true;
collisions.slopeNormal =
hit.normal;
}
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 91
if (hit) {
Vector2.up);
moveAmount.x = Mathf.Sign(hit.normal.x) *
Mathf.Deg2Rad);
collisions.slopeAngle = slopeAngle;
collisions.slidingDownMaxSlope = true;
collisions.slopeNormal = hit.normal;
}
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 92
void ResetFallingThroughPlatform() {
collisions.fallingThroughPlatform = false;
climbingSlope = false;
descendingSlope = false;
slidingDownMaxSlope = false;
slopeNormal = Vector2.zero;
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 93
slopeAngleOld = slopeAngle;
slopeAngle = 0;
}
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 94
APPENDIX E : Survey
COMPUTER COLLEGE CALAMBA CAMPUS
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY 95