Arduino lcd game problems, endless runner code not working












0















i have a game i have downloaded and built, have a file here, (file is too large to put on here), i am posting the whole thing because i dot know why the code wont work. that file is the original (from here). i am using the correct arduino for it as i have the redboard. i try to make the 0 pin an input, that when on high, turns off this bit of code :
// Draw hero on screen and check for collisions
if (drawHero(heroPos, terrainUpper, terrainLower, distance >> 3)) {
playing = false; // The hero collided with something. Too bad.
}


i can switch the high and low testing in the modified file at the bottom of the page, but the code wont look at the state of the switch i have wired up to the 0 pin and my 5 volt rail. i am new to this btw, so if you give a possible solution, please explain it like you are tanking to a person who has coding experience, just not with arduino and c++.



the file modification is right here.



by the way, the if statement changes god mode on and off by only letting collision detection happen when the switch is on low.



this is the original circuit:https://cdn.sparkfun.com/assets/learn_tutorials/7/1/6/Endless_Runner_bb1.png
added a board on the side that connects to the positive rail on the main board, then i have a switch that connects to the 0 pin and the positive rail on the side board.










share|improve this question













migrated from stackoverflow.com Nov 27 '18 at 17:41


This question came from our site for professional and enthusiast programmers.



















  • wire the button you added, the same way like the first button

    – Juraj
    Nov 27 '18 at 18:12
















0















i have a game i have downloaded and built, have a file here, (file is too large to put on here), i am posting the whole thing because i dot know why the code wont work. that file is the original (from here). i am using the correct arduino for it as i have the redboard. i try to make the 0 pin an input, that when on high, turns off this bit of code :
// Draw hero on screen and check for collisions
if (drawHero(heroPos, terrainUpper, terrainLower, distance >> 3)) {
playing = false; // The hero collided with something. Too bad.
}


i can switch the high and low testing in the modified file at the bottom of the page, but the code wont look at the state of the switch i have wired up to the 0 pin and my 5 volt rail. i am new to this btw, so if you give a possible solution, please explain it like you are tanking to a person who has coding experience, just not with arduino and c++.



the file modification is right here.



by the way, the if statement changes god mode on and off by only letting collision detection happen when the switch is on low.



this is the original circuit:https://cdn.sparkfun.com/assets/learn_tutorials/7/1/6/Endless_Runner_bb1.png
added a board on the side that connects to the positive rail on the main board, then i have a switch that connects to the 0 pin and the positive rail on the side board.










share|improve this question













migrated from stackoverflow.com Nov 27 '18 at 17:41


This question came from our site for professional and enthusiast programmers.



















  • wire the button you added, the same way like the first button

    – Juraj
    Nov 27 '18 at 18:12














0












0








0








i have a game i have downloaded and built, have a file here, (file is too large to put on here), i am posting the whole thing because i dot know why the code wont work. that file is the original (from here). i am using the correct arduino for it as i have the redboard. i try to make the 0 pin an input, that when on high, turns off this bit of code :
// Draw hero on screen and check for collisions
if (drawHero(heroPos, terrainUpper, terrainLower, distance >> 3)) {
playing = false; // The hero collided with something. Too bad.
}


i can switch the high and low testing in the modified file at the bottom of the page, but the code wont look at the state of the switch i have wired up to the 0 pin and my 5 volt rail. i am new to this btw, so if you give a possible solution, please explain it like you are tanking to a person who has coding experience, just not with arduino and c++.



the file modification is right here.



by the way, the if statement changes god mode on and off by only letting collision detection happen when the switch is on low.



this is the original circuit:https://cdn.sparkfun.com/assets/learn_tutorials/7/1/6/Endless_Runner_bb1.png
added a board on the side that connects to the positive rail on the main board, then i have a switch that connects to the 0 pin and the positive rail on the side board.










share|improve this question














i have a game i have downloaded and built, have a file here, (file is too large to put on here), i am posting the whole thing because i dot know why the code wont work. that file is the original (from here). i am using the correct arduino for it as i have the redboard. i try to make the 0 pin an input, that when on high, turns off this bit of code :
// Draw hero on screen and check for collisions
if (drawHero(heroPos, terrainUpper, terrainLower, distance >> 3)) {
playing = false; // The hero collided with something. Too bad.
}


i can switch the high and low testing in the modified file at the bottom of the page, but the code wont look at the state of the switch i have wired up to the 0 pin and my 5 volt rail. i am new to this btw, so if you give a possible solution, please explain it like you are tanking to a person who has coding experience, just not with arduino and c++.



the file modification is right here.



by the way, the if statement changes god mode on and off by only letting collision detection happen when the switch is on low.



this is the original circuit:https://cdn.sparkfun.com/assets/learn_tutorials/7/1/6/Endless_Runner_bb1.png
added a board on the side that connects to the positive rail on the main board, then i have a switch that connects to the 0 pin and the positive rail on the side board.







c++ lcd






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 '18 at 19:27







Vortetty











migrated from stackoverflow.com Nov 27 '18 at 17:41


This question came from our site for professional and enthusiast programmers.









migrated from stackoverflow.com Nov 27 '18 at 17:41


This question came from our site for professional and enthusiast programmers.















  • wire the button you added, the same way like the first button

    – Juraj
    Nov 27 '18 at 18:12



















  • wire the button you added, the same way like the first button

    – Juraj
    Nov 27 '18 at 18:12

















wire the button you added, the same way like the first button

– Juraj
Nov 27 '18 at 18:12





wire the button you added, the same way like the first button

– Juraj
Nov 27 '18 at 18:12










0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function () {
return StackExchange.using("schematics", function () {
StackExchange.schematics.init();
});
}, "cicuitlab");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "540"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2farduino.stackexchange.com%2fquestions%2f58254%2farduino-lcd-game-problems-endless-runner-code-not-working%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown
























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Arduino Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2farduino.stackexchange.com%2fquestions%2f58254%2farduino-lcd-game-problems-endless-runner-code-not-working%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Florida Star v. B. J. F.

Error while running script in elastic search , gateway timeout

Adding quotations to stringified JSON object values