Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
22 May, 2013, 01:33:38 *
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]   Go Down
  Print  
Author Topic: [Axe] Problème lors de l'affichage d'une map simple -  (Read 1000 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
nikoladu49
LV0 Newcomer (Next: 5)

Offline Offline

Last Login: 09 April, 2011, 13:58:38
Date Registered: 21 March, 2011, 09:59:53
Posts: 3

Topic starter
Total Post Ratings: 0

View Profile
« on: 21 March, 2011, 10:07:23 »
0

Bonjour, j'ai commencé à créer mon premier jeu, mais je rencontre déjà des problèmes.
Ma map est composé de 2 sprites différents (l'un tout blanc, l'autre tout noir) mais seul le premier sprite s'affiche, et partout sur l'écran (c'est ce que j'ai remarqué après quelques tests).
 
Voici le code complet du programme :

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
:[000F09FE7FE64870]→Pic0AV

:[0000000000000000]→Pic0M1
:[FFFFFFFFFFFFFFFF]
:
:[000000111111]→GDB0M1
:[000000111111]
:[000000111111]
:[000000000000]
:[000000000000]
:[000000111111]
:[000000111111]
:[000000111111]
:
:0→X
:56→Y
:
:ClrDraw
:sub(MAP,GDB0M1,Pic0M1
:
:Repeat getKey(15)
:   sub(TRN,1,(Y<56),2
:   sub(TRN,4,(Y>0),‾2
:   
:   Pause 1
:   X+1→X
:   
:   sub(PTC,Pic0AV
:   DispGraph
:   sub(PTC,Pic0AV
:   Pause 100
:End
:
:Return
:
:
:Lbl TRN
:If getKey(r1) and r2
:   Y+r3→Y
:End
:Return
:
:Lbl PTC
:Pt-Change(X,Y,r1
:Return
:
:Lbl MAP
:For(W,0,7
:   For(V,0,5
:      {W*6+X+r1}→A
:      Pt-On(V*16,W*8,A/16*8+r2
:      Pt-On(V*16+8,W*8,A^16*8+r2
:   End
:End
:DispGraph
:Return
 

Je ne vois pas trop où est mon erreur.
Mais je pense qu'elle se situe dans la fonction MAP.

Merci d'avance.

PS : est-ce-que quelqu'un pourrait m'expliquer plus en détails les calculs qui sont faits pour afficher une map. Je n'ai pas trop compris sur le tutoriel du site du zéro (mais je remercie ces auteurs pour leur excellent travail Grin).
Logged
mdr1
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: Yesterday at 23:02:47
Date Registered: 31 December, 2010, 23:36:39
Posts: 191


Total Post Ratings: +9

View Profile
« Reply #1 on: 22 March, 2011, 18:47:42 »
+1

Il y a déjà une première faute, là :

1
:      {W*6+X+r1}→A
Ne faut-il pas multiplier W par 8 ? Et puis pourquoi V n'intervient pas dans cette formule ?
Logged

nikoladu49
LV0 Newcomer (Next: 5)

Offline Offline

Last Login: 09 April, 2011, 13:58:38
Date Registered: 21 March, 2011, 09:59:53
Posts: 3

Topic starter
Total Post Ratings: 0

View Profile
« Reply #2 on: 26 March, 2011, 15:35:22 »
0

Merci pour ta réponse.

Le problème venait de cette ligne là. J'ai mis X au lieu de V (erreur d'étourderie).
Par contre en multipliant W par 6 ça fonctionne.
Logged
Kiligolo
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 13 January, 2013, 11:35:54
Date Registered: 11 October, 2010, 18:01:20
Location: France
Posts: 218


Total Post Ratings: +5

View Profile
« Reply #3 on: 26 March, 2011, 15:45:15 »
0

Il faut multiplier par huit car c'est des sprites 8x8 donc ça avance de huit en huit. Dans ce cas là ça ne ce voit pas car c'est des sprites en noir et blanc mais essaye ça avec d'autre sprites comme un smiley où quelque chose dans ce genre et tu verra.
Logged

Spoiler for Calcul Mental:
Version 1.3 :100%!!
Here is a program that reduces your dependence on the calculator! Click here!
Spoiler for Some screen shots:
       
The screenshots are in french but there is an english version
kindermoumoute
LV8 Addict (Next: 1000)
********
Offline Offline

Last Login: 20 May, 2013, 23:02:59
Date Registered: 15 May, 2010, 17:53:56
Posts: 836


Total Post Ratings: +51

View Profile
« Reply #4 on: 26 March, 2011, 16:06:00 »
0

Mais non, c'est bien par 6 qu'il faut multiplier, car l'écran fait 12*8 sprites. W est la largeur, et dans la tilemap 2 sprites sont stockés dans 1 octet, donc 12/2=6.
(C'est marqué dans mon tutoriel Kiligolo)
Comme un sprite fait 8 pixels * 8 pixels, à l'affichage on retrouve 12*8 et 8*8, soit les dimensions de l'écran : 96*64.
Logged

Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%
Kiligolo
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 13 January, 2013, 11:35:54
Date Registered: 11 October, 2010, 18:01:20
Location: France
Posts: 218


Total Post Ratings: +5

View Profile
« Reply #5 on: 26 March, 2011, 19:53:44 »
0

ah ok désolé :p
Logged

Spoiler for Calcul Mental:
Version 1.3 :100%!!
Here is a program that reduces your dependence on the calculator! Click here!
Spoiler for Some screen shots:
       
The screenshots are in french but there is an english version
mdr1
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: Yesterday at 23:02:47
Date Registered: 31 December, 2010, 23:36:39
Posts: 191


Total Post Ratings: +9

View Profile
« Reply #6 on: 27 March, 2011, 17:40:22 »
0

Merci pour ta réponse.

Le problème venait de cette ligne là. J'ai mis X au lieu de V (erreur d'étourderie).
Spoiler for Hidden:
Et mon +1 ?  Grin
Logged

kindermoumoute
LV8 Addict (Next: 1000)
********
Offline Offline

Last Login: 20 May, 2013, 23:02:59
Date Registered: 15 May, 2010, 17:53:56
Posts: 836


Total Post Ratings: +51

View Profile
« Reply #7 on: 27 March, 2011, 18:49:34 »
0

Je te l'offre, mais j'avais déjà répondu à son problème sur TI-Bank. :p
Logged

Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 08:22:03
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50208


Total Post Ratings: +2613

View Profile WWW
« Reply #8 on: 27 March, 2011, 20:26:30 »
0

Au fait bienvenue sur le forum Grin
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
nikoladu49
LV0 Newcomer (Next: 5)

Offline Offline

Last Login: 09 April, 2011, 13:58:38
Date Registered: 21 March, 2011, 09:59:53
Posts: 3

Topic starter
Total Post Ratings: 0

View Profile
« Reply #9 on: 27 March, 2011, 21:38:15 »
0

kindermoumoute : oui c'est vrai. J'avais pas eu trop le temps pour tester les autres remarques que tu m'avais fait. J'ai répondu sur Ti Bank.

DJ_O : merci  Smiley
Logged
Pages: [1]   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.254 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.