-->
Animating an 8x8 sprite with facing
-->
-->
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
-->
Home
About
Team
Rules
Stats
Status
Sitemap
Chat
Downloads
Forum
News
Our Projects
Major Community Projects
Recent Posts
Unread Posts
Replies
Tools
SourceCoder3
Other Things...
Omnimaga Radio
TI-83 Plus ASM File Unsquisher
Z80 Conversion Tools
IES TI File Editor
Free RAM areas
Comprehensive Getkeyr table
URL Shortener
Online Axe Tilemap Editor
Help
Contact Us
Change Request
Report Issue/Bug
Team
Articles
Members
View the memberlist
Search For Members
Buddies
Login
Register
Omnimaga
»
Forum
»
Calculator Community
»
TI Calculators
»
Axe
(Moderator:
Runer112
) »
Animating an 8x8 sprite with facing
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Animating an 8x8 sprite with facing (Read 7645 times)
0 Members and 1 Guest are viewing this topic.
Raylin
Godslayer
LV10
31337 u53r (Next: 2000)
Posts: 1392
Rating: +83/-25
I am a certifiable squirrel ninja.
Animating an 8x8 sprite with facing
«
on:
September 09, 2010, 10:50:21 am »
What would be the best way to make an animated sprite move with regards to facing?
Logged
Bug me about my book.
Sarah:
TI-83 Plus Silver Edition [OS 1.19]
Cassie:
TI-86 [OS 1.XX]
Elizabeth:
TI-81 [OS 1.XX]
Jehuty:
TI-83 Plus Silver Edition [OS 1.19]
Tesla:
CASIO Prizm
Runer112
Project Author
LV11
Super Veteran (Next: 3000)
Posts: 2289
Rating: +639/-31
Re: Animating an 8x8 sprite with facing
«
Reply #1 on:
September 09, 2010, 01:07:00 pm »
I don't understand what you mean.
«
Last Edit: September 09, 2010, 01:07:17 pm by Runer112
»
Logged
Raylin
Godslayer
LV10
31337 u53r (Next: 2000)
Posts: 1392
Rating: +83/-25
I am a certifiable squirrel ninja.
Re: Animating an 8x8 sprite with facing
«
Reply #2 on:
September 09, 2010, 01:36:58 pm »
If you press left, he runs left. If you press right, he runs right.
Logged
Bug me about my book.
Sarah:
TI-83 Plus Silver Edition [OS 1.19]
Cassie:
TI-86 [OS 1.XX]
Elizabeth:
TI-81 [OS 1.XX]
Jehuty:
TI-83 Plus Silver Edition [OS 1.19]
Tesla:
CASIO Prizm
Runer112
Project Author
LV11
Super Veteran (Next: 3000)
Posts: 2289
Rating: +639/-31
Re: Animating an 8x8 sprite with facing
«
Reply #3 on:
September 09, 2010, 01:39:11 pm »
Give the sprite both position and diretion/velocity variables. Design the sprites to face one way, but when drawing, check the velocity/direction and display either the sprite or flipH() of the sprite accordingly.
Logged
Raylin
Godslayer
LV10
31337 u53r (Next: 2000)
Posts: 1392
Rating: +83/-25
I am a certifiable squirrel ninja.
Re: Animating an 8x8 sprite with facing
«
Reply #4 on:
September 09, 2010, 01:57:56 pm »
Uhm... Any other opinions?
Logged
Bug me about my book.
Sarah:
TI-83 Plus Silver Edition [OS 1.19]
Cassie:
TI-86 [OS 1.XX]
Elizabeth:
TI-81 [OS 1.XX]
Jehuty:
TI-83 Plus Silver Edition [OS 1.19]
Tesla:
CASIO Prizm
Builderboy
Physics Guru
CoT Emeritus
LV13
Extreme Addict (Next: 9001)
Posts: 5673
Rating: +613/-9
Would you kindly?
Re: Animating an 8x8 sprite with facing
«
Reply #5 on:
September 09, 2010, 02:01:23 pm »
What runner said is pretty much the way to do it. Are you confused with his explanation or do you want to do something else?
Logged
Raylin
Godslayer
LV10
31337 u53r (Next: 2000)
Posts: 1392
Rating: +83/-25
I am a certifiable squirrel ninja.
Re: Animating an 8x8 sprite with facing
«
Reply #6 on:
September 09, 2010, 02:02:29 pm »
Well, won't I have to use an If conditional to flipH() the sprite while trying to display the thing?
Won't that slow it down?
Logged
Bug me about my book.
Sarah:
TI-83 Plus Silver Edition [OS 1.19]
Cassie:
TI-86 [OS 1.XX]
Elizabeth:
TI-81 [OS 1.XX]
Jehuty:
TI-83 Plus Silver Edition [OS 1.19]
Tesla:
CASIO Prizm
calc84maniac
eZ80 Guru
Coder Of Tomorrow
LV11
Super Veteran (Next: 3000)
Posts: 2913
Rating: +471/-17
Re: Animating an 8x8 sprite with facing
«
Reply #7 on:
September 09, 2010, 02:04:23 pm »
I think you are overestimating the delay caused by things in Axe. This is nowhere close to TI-Basic slowness.
Logged
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman
Builderboy
Physics Guru
CoT Emeritus
LV13
Extreme Addict (Next: 9001)
Posts: 5673
Rating: +613/-9
Would you kindly?
Re: Animating an 8x8 sprite with facing
«
Reply #8 on:
September 09, 2010, 02:10:30 pm »
An If conditional probably could execute hundreds of times before it took the amount of time it takes to draw a single sprite. You might be able to get around this with some boolean trickery, but unless a way is figured out, the if statement is a viable option
Logged
Quigibo
The Executioner
CoT Emeritus
LV11
Super Veteran (Next: 3000)
Posts: 2031
Rating: +1075/-24
I wish real life had a "Save" and "Load" button...
Re: Animating an 8x8 sprite with facing
«
Reply #9 on:
September 09, 2010, 02:33:59 pm »
If you have like 100 sprites doing this it will definitely slow down, but with a single sprite, there will be no slowdown. If you want a super speed optimized method instead of a convenient one, you need a 16 sprite array. 4 for each direction and 4 frames per animation. Then, you can just look up the correct sprite with Pt-On(X,Y,D*4+(T^4)+Pic1) where D is direction (0,1,2, or 3) and T is the "step timer". Usually, you can just replace T with X+Y or something similar, it depends on the speed of animation and other factors you might want. The downside of this though is that even though the total amount of size in the executable will be around the same, its a hassle to have to draw 16 individual sprites for each character.
Logged
___Axe_Parser___
Today the calculator, tomorrow the world!
Print
Pages: [
1
]
Go Up
« previous
next »
Omnimaga
»
Forum
»
Calculator Community
»
TI Calculators
»
Axe
(Moderator:
Runer112
) »
Animating an 8x8 sprite with facing
\n\t\t\t\t\t\t\t\t\t
<' + '/div>\n\t\t\t\t\t\t\t\t\t
%body%<' + '/textarea>
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
Max characters: 20000; characters remaining:
...<' + '/span><' + '/span>
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t<' + '/div>\n\t\t\t\t\t\t\t\t<' + '/div>', sTemplateSubjectEdit: '
', sTemplateBodyNormal: '%body%', sTemplateSubjectNormal: '
%subject%<' + '/a>', sTemplateTopSubject: 'Topic: %subject% (Read 7645 times)', sErrorBorderStyle: '1px solid red' }); aJumpTo[aJumpTo.length] = new JumpTo({ sContainerId: "display_jump_to", sJumpToTemplate: "
Jump to:<" + "/label> %dropdown_list%", iCurBoardId: 162, iCurBoardChildLevel: 1, sCurBoardName: "Axe", sBoardChildLevelIndicator: "==", sBoardPrefix: "=> ", sCatSeparator: "-----------------------------", sCatPrefix: "", sGoButtonLabel: "go" }); aIconLists[aIconLists.length] = new IconList({ sBackReference: "aIconLists[" + aIconLists.length + "]", sIconIdPrefix: "msg_icon_", sScriptUrl: smf_scripturl, bShowModify: true, iBoardId: 162, iTopicId: 6996, sSessionId: "10c504e278342c2da8fcb0d881e59106", sSessionVar: "a435a72a2", sLabelIconList: "Message Icon", sBoxBackground: "transparent", sBoxBackgroundHover: "#ffffff", iBoxBorderWidthHover: 1, sBoxBorderColorHover: "#adadad" , sContainerBackground: "#ffffff", sContainerBorder: "1px solid #adadad", sItemBorder: "1px solid #ffffff", sItemBorderHover: "1px dotted gray", sItemBackground: "transparent", sItemBackgroundHover: "#e0e0f0" }); } function tick2() { if (typeof(document.forms.quickModForm) != "undefined") { calcCharLeft2(); setTimeout("tick2()", 1000); } else setTimeout("tick2()", 800); } function message_onkeyup() { if (typeof(document.forms.quickModForm) != "undefined" && typeof(document.forms.quickModForm.message) != "undefined") { document.forms.quickModForm.message.onkeyup = function onkeyup(event) { storeCaret(this); calcCharLeft2(); }; } else setTimeout("message_onkeyup()", 800); } message_onkeyup(); function calcCharLeft2() { var maxLength = 20000; var oldEditor = "", currentEditor = document.forms.quickModForm.message.value; if (!document.getElementById("editorLeft2")) return; if (oldEditor != currentEditor) { oldEditor = currentEditor; if (currentEditor.replace(/\r/, "").length > maxLength) document.forms.quickModForm.message.value = currentEditor.replace(/\r/, "").substring(0, maxLength); currentEditor = document.forms.quickModForm.message.value.replace(/\r/, ""); } setInnerHTML(document.getElementById("editorLeft2"), maxLength - currentEditor.length); } // ]]>-->