Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 June, 2013, 05:32:58 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2   Go Down
  Print  
Author Topic: scrolling and tilemapping tutorial?!?! -  (Read 826 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
saintrunner
Custom Spriter: You ask it! I'll Make it!
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 02:00:40
Date Registered: 27 October, 2011, 21:52:46
Location: Right here....I think?
Posts: 1776


Topic starter
Total Post Ratings: +97

View Profile WWW
« on: 21 January, 2012, 04:39:02 »
0

So after finally learning tilemapping, I am finding I can't figure out how to implement scrolling! I wanted to get it so when I started moving right or left the screen moved the opposite direction. but to be honest I don't think my tilemapping is gonna work. so could someone make me a tutorial on a sidescrolling tilemap? And I want this for a platformer jsyk

Thanks Smiley
Logged

My Sprites Thread   :Updated often Smiley for your viewing pleasure

GAMES:
nxtboy III
LV8 Addict (Next: 1000)
********
Offline Offline

Last Login: Yesterday at 22:22:51
Date Registered: 30 March, 2011, 22:57:58
Posts: 784


Total Post Ratings: +23

View Profile WWW
« Reply #1 on: 21 January, 2012, 04:39:59 »
0

BTW, what platformer are you making?
Logged

saintrunner
Custom Spriter: You ask it! I'll Make it!
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 02:00:40
Date Registered: 27 October, 2011, 21:52:46
Location: Right here....I think?
Posts: 1776


Topic starter
Total Post Ratings: +97

View Profile WWW
« Reply #2 on: 21 January, 2012, 04:45:24 »
0

Seeker 2: The Body  OH and this is in axe
Logged

My Sprites Thread   :Updated often Smiley for your viewing pleasure

GAMES:
leafy
Coder Of Tomorrow
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 02:19:41
Date Registered: 26 December, 2010, 05:27:03
Location: the ninth circle of hell
Posts: 1555


Total Post Ratings: +372

View Profile WWW
« Reply #3 on: 21 January, 2012, 08:25:47 »
0

There are plenty of tutorials lying around this site if you can use that search box up there Tongue

It's a bit difficult for platformers, especially if you want it to run fast, but you'll figure it out ^^

EDIT: I'll start writing a scrolling platformer tutorial if you guys want.
« Last Edit: 21 January, 2012, 09:02:47 by leafiness0 » Logged

In-progress: Blastlabs, TMJO, qb?, VVVVVV?
Finished: Tag, Tap, MFQT, Nyan
Dead: Graviter
saintrunner
Custom Spriter: You ask it! I'll Make it!
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 02:00:40
Date Registered: 27 October, 2011, 21:52:46
Location: Right here....I think?
Posts: 1776


Topic starter
Total Post Ratings: +97

View Profile WWW
« Reply #4 on: 21 January, 2012, 18:36:02 »
0

Yeah I did search it but I couldn't find something that made sense, so yeah thanks I'd really appreciate it leafy Smiley
Logged

My Sprites Thread   :Updated often Smiley for your viewing pleasure

GAMES:
turiqwalrus
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Yesterday at 21:11:35
Date Registered: 25 November, 2010, 00:38:42
Location: In a shadowed grotto far from the eyes of the world.
Posts: 728


Total Post Ratings: +46

View Profile
« Reply #5 on: 21 January, 2012, 19:25:18 »
0

check the tutorials section...
at the very bottom, you should be able to see yunhua's tutorial...
it's slightly unoptimized for tutorial purposes, but it should be fine.
Logged
saintrunner
Custom Spriter: You ask it! I'll Make it!
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 02:00:40
Date Registered: 27 October, 2011, 21:52:46
Location: Right here....I think?
Posts: 1776


Topic starter
Total Post Ratings: +97

View Profile WWW
« Reply #6 on: 21 January, 2012, 19:47:48 »
0

Yeah I saw that but I didn't understand it much. Plus thats for an RPG and I want one easily fitted for a platformer, I'll check it out again anyways thanks, I might understand it now since the last time I checked it was a month ago before I actually understood tile mapping
Logged

My Sprites Thread   :Updated often Smiley for your viewing pleasure

GAMES:
yunhua98
You won't this read sentence right.
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2012, 03:06:37
Date Registered: 26 May, 2010, 22:58:45
Location: Somewhere in Deep Space.
Posts: 2717


Total Post Ratings: +199

View Profile
« Reply #7 on: 21 January, 2012, 22:22:39 »
0

If your platformer is smooth scrolling with physics, you might have to change the code up quite a bit.  If it uses simple physics, then you can use the same code pretty much, except have a constant gravity.
Logged


Spoiler for =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.

On hold for Contest.


Spoiler for ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11

saintrunner
Custom Spriter: You ask it! I'll Make it!
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 02:00:40
Date Registered: 27 October, 2011, 21:52:46
Location: Right here....I think?
Posts: 1776


Topic starter
Total Post Ratings: +97

View Profile WWW
« Reply #8 on: 21 January, 2012, 22:27:10 »
0

this is my code...can you help modify it to work? and I know the map is small I'll make it larger once i get the scrolling



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
:.TILES
:Full
:Lbl TMAP
:ClrDraw
:[010101010101010101010101]→GDB1
:[010000000000000000000001]
:[010000000000000000000001]
:[010000000000000101010101]
:[010000000000000000000001]
:[010001010100000000000001]
:[010000000000000000000001]
:[010101010101010101010101]
:[7E81A581A599817E]→Pic1
:For(B,0,7)
:For(A,0,11)
:{B*12+A+GDB1}→T
:If T
:T--
:Pt-On(A*8,B*8,T*8+Pic1)
:DispGraph
:End
:End
:End
:[3C429581818D423C]→Pic1MAN
:[003C7E7E7E7E3C00]→Pic2MAN
:[3C42A98181B1423C]→Pic3MAN
:45→X:45→Y:0→J:1→D
:Repeat getKey(15)
:
:Pt-On(X,Y,Pic2MAN)r
:If getKey(2) and (pxl-Test(X-1,Y+6)=0) and (pxl-Test(X-1,Y+1)=0)
:X--
:2→D
:End
:If getKey(3) and (pxl-Test(X+8,Y+6)=0) and (pxl-Test(X+8,Y+1)=0)
:X++
:1→D
:End
:If getKey(4) and (pxl-Test(X+1,Y+8) or pxl-Test(X+7,Y+8)
:18→J
:End
:If (J>0)
:Y--
:J--
:End
:If (pxl-Test(X+6,Y+8)=0) and (pxl-Test(X+1,Y+8)=0) and (J=0) or (pxl-Test(X,Y) or (pxl-Test(X+7,Y)
:Y++
:0→J
:End
:If getKey(1) and (pxl-Test(X,Y+8)=0) and (pxl-Test(X,Y+8)=0)
:Y++
:0→J
:End
:If (D=1)
:Pt-Change(X,Y,Pic1MAN)
:End
:If (D=2)
:Pt-Change(X,Y,Pic3MAN)
:End
:Pause 25
:DispGraph
:DispGraphr
:ClrDrawr
:If (D=1)
:Pt-Change(X,Y,Pic1MAN)
:End
:If (D=2)
:Pt-Change(X,Y,Pic3MAN)
:End
:End
« Last Edit: 21 January, 2012, 22:27:54 by saintrunner » Logged

My Sprites Thread   :Updated often Smiley for your viewing pleasure

GAMES:
yunhua98
You won't this read sentence right.
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2012, 03:06:37
Date Registered: 26 May, 2010, 22:58:45
Location: Somewhere in Deep Space.
Posts: 2717


Total Post Ratings: +199

View Profile
« Reply #9 on: 21 January, 2012, 22:31:19 »
0

could you tell me what each of your pointers, not counting the sprite pointers, do?  I'm really bad at understanding other people's code.  Tongue
Logged


Spoiler for =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.

On hold for Contest.


Spoiler for ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11

saintrunner
Custom Spriter: You ask it! I'll Make it!
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 02:00:40
Date Registered: 27 October, 2011, 21:52:46
Location: Right here....I think?
Posts: 1776


Topic starter
Total Post Ratings: +97

View Profile WWW
« Reply #10 on: 21 January, 2012, 22:34:57 »
0

A is columns and B is rows, J is for jumping, X and Y are for your characters position, and D is just the direction you face
Logged

My Sprites Thread   :Updated often Smiley for your viewing pleasure

GAMES:
yunhua98
You won't this read sentence right.
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2012, 03:06:37
Date Registered: 26 May, 2010, 22:58:45
Location: Somewhere in Deep Space.
Posts: 2717


Total Post Ratings: +199

View Profile
« Reply #11 on: 21 January, 2012, 22:38:12 »
0

In line 50, why do you have pxl-test(X, Y+8) twice?  as for scrolling, I'm working on that right now.  Wink
« Last Edit: 21 January, 2012, 22:54:43 by yunhua98 » Logged


Spoiler for =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.

On hold for Contest.


Spoiler for ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11

saintrunner
Custom Spriter: You ask it! I'll Make it!
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 02:00:40
Date Registered: 27 October, 2011, 21:52:46
Location: Right here....I think?
Posts: 1776


Topic starter
Total Post Ratings: +97

View Profile WWW
« Reply #12 on: 21 January, 2012, 22:45:24 »
0

Just a copy and paste error Tongue sorry, and THANKS SO MUCH FOR HELPING ME!!!
Logged

My Sprites Thread   :Updated often Smiley for your viewing pleasure

GAMES:
adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: 14 June, 2013, 17:56:38
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1202


Total Post Ratings: +186

View Profile WWW
« Reply #13 on: 21 January, 2012, 22:48:18 »
0

On TI-Planet ( here ), a member suggested this :

Quote
Si tu veux faire du tilemapping pixel par pixel, il faut en effet utiliser le smooth scrolling. Je vais essayer de t'expliquer comment faire :
Tout d'abord , tu dois changer de signe deux variables (I et J) en fonction de la direction où tu vas comme ceci :
CODE: TOUT SÉLECTIONNER
:If getKey(3) and (I=0) and (J=0)
:1→I
:End
:If getKey(2) and (I=0) and (J=0)
:-1→I
:End
:If getKey(1) and (I=0) and (J=0)
:1→J
:End
:If getKey(4) and (I=0) and (J=0)
:-1→J
:End


Ensuite tu les ajoutes à H et V (le décalage horizontale et verticale sur la map entre 0 et 8 ) :
CODE: TOUT SÉLECTIONNER
H+I+I→H
V+J+J→V

Lorsque tu as bougé de 8 pixels, tu rajoute (ou soustrait 1) à la position horizontale/verticale (ici P = horizontale et Q = verticale) :
CODE: TOUT SÉLECTIONNER
:If H-8=0 or (H+8=0
Tongue+I→P
:0→H→I
:End
:If V-8=0 or (V+8=0
:Q+J→Q
:0→V→J
:End


En tout, tu as :
CODE: TOUT SÉLECTIONNER
:Repeat getKey(15)
:
:If getKey(3) and (I=0) and (J=0)
:1→I
:End
:If getKey(2) and (I=0) and (J=0)
:-1→I
:End
:If getKey(1) and (I=0) and (J=0)
:1→J
:End
:If getKey(4) and (I=0) and (J=0)
:-1→J
:End
:
:
:H+I+I→H
:V+J+J→V
:
:If H-8=0 or (H+8=0
Tongue+I→P
:0→H→I
:End
:If V-8=0 or (V+8=0
:Q+J→Q
:0→V→J
:End
:
:sub(MAP)
:Pt-Off(48,32,Pic1
:DispGraphClrDraw
:End
:Return


sub(MAP) appellera la fonction qui s'occupe d'afficher la map à l'écran et Pic1 contient le sprite du personnage.

Pour voir les tiles sur le bord quand tu te déplace, tu dois avoir préalablement affiché la colonne/ligne d'après/avant.
Voilà maintenant le code de la fonction MAP :
CODE: TOUT SÉLECTIONNER
:Lbl MAP
:For(Y,0,9
:For(X,0,13
:Pt-On(X*8-8-H,Y*8-8-V,{Y+Q*[largeur de la map]+X+P+GDB1}*8+Pic0
:End
:End
:Return

avec GDB1, un pointeur sur la map et Pic0, un pointeur sur les tiles.

En espérant t'avoir aidé.
Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
saintrunner
Custom Spriter: You ask it! I'll Make it!
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 02:00:40
Date Registered: 27 October, 2011, 21:52:46
Location: Right here....I think?
Posts: 1776


Topic starter
Total Post Ratings: +97

View Profile WWW
« Reply #14 on: 21 January, 2012, 22:49:13 »
0

In english?
Logged

My Sprites Thread   :Updated often Smiley for your viewing pleasure

GAMES:
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.339 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.