Author Topic: Sprites and Maps in C 68k  (Read 19820 times)

0 Members and 1 Guest are viewing this topic.

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Sprites and Maps in C 68k
« Reply #30 on: January 31, 2012, 02:17:42 pm »
You have the entire rights to make any program for learning purposes - but if you're not making this program for learning purposes, maybe you could join forces with Torio ? :)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline Kiligolo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 218
  • Rating: +10/-1
    • View Profile
Re: Sprites and Maps in C 68k
« Reply #31 on: January 31, 2012, 02:29:38 pm »
If he want, why not! Even if I learn C with this program, it can be a serious project if it works but now it's still a test game.
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

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Sprites and Maps in C 68k
« Reply #32 on: January 31, 2012, 02:32:14 pm »
OK, it's good if you're still learning. I just wanted to make sure that you were not both, in the exact same time frame, aiming at making a release-quality Pokemon port ;)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline Kiligolo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 218
  • Rating: +10/-1
    • View Profile
Re: Sprites and Maps in C 68k
« Reply #33 on: January 31, 2012, 02:37:57 pm »
It's not pokémon but zelda (at the beginning i wanted to make a pokemon game but now it's more a zelda game, i am too tired to rename files... ^^')
« Last Edit: January 31, 2012, 02:38:24 pm by Kiligolo »
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

Offline Torio

  • LV3 Member (Next: 100)
  • ***
  • Posts: 83
  • Rating: +22/-0
    • View Profile
Re: Sprites and Maps in C 68k
« Reply #34 on: February 01, 2012, 10:49:52 am »
I'm busy enough with Pokemon for now, so I'm afraid I won't be able to start another project.
However you can still ask me questions if you have problems with your game !
Sorry about my mistakes, I'm French.

Projects :  Pokemon TI-89 | Ti-Tank

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Sprites and Maps in C 68k
« Reply #35 on: February 01, 2012, 01:04:48 pm »
I didn't look at his archive further than the name, so I tried to make sure that you two weren't making the same thing; but they're projects with little in common, so you wouldn't be able to work much on each others' project anyway :)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline Torio

  • LV3 Member (Next: 100)
  • ***
  • Posts: 83
  • Rating: +22/-0
    • View Profile
Re: Sprites and Maps in C 68k
« Reply #36 on: February 05, 2012, 06:16:30 am »
I studied your code and spotted another error, which could be also naughty for your calculator :

Code: [Select]
//Actualisation de la position de l'utilisateur
pUserx += (key == KEY_RIGHT) - (key == KEY_LEFT);
pUsery += (key == KEY_DOWN) - (key == KEY_UP);

//Verification de sa position
if (map1[pUsery][pUserx] == 1 || map1[pUsery][pUserx] == 3 || (map1[pUsery][pUserx] > 4 && map1[pUsery][pUserx] != 14 && map1[pUsery][pUserx] < 21) || pUserx == 21 || pUserx == -1 || pUsery == -1 || pUsery == 13)
{
pUserx -= (key == KEY_RIGHT) - (key == KEY_LEFT);
pUsery -= (key == KEY_DOWN) - (key == KEY_UP);
}

When you check the position of the user and that he tries to go out of the limits, his position will be changed but you will also call map1[pUsery][pUserx] in the if condition...
If pUserx is 21 for example, you will go to a memory place you shouldn't have access to...
Sorry about my mistakes, I'm French.

Projects :  Pokemon TI-89 | Ti-Tank

Offline Kiligolo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 218
  • Rating: +10/-1
    • View Profile
Re: Sprites and Maps in C 68k
« Reply #37 on: February 17, 2012, 04:59:05 pm »
Yes youre right but im not changing value of memory adress so its ok isnt it?
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

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Sprites and Maps in C 68k
« Reply #38 on: February 18, 2012, 01:50:30 am »
You're not writing out of the bounds of the buffer, but you're nevertheless reading outside the bounds... which is unlikely to yield correct behaviour down the road ;)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline Kiligolo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 218
  • Rating: +10/-1
    • View Profile
Re: Sprites and Maps in C 68k
« Reply #39 on: February 18, 2012, 08:13:53 am »
It's an OR condition : if pUserx = 21 it's true and map[pUsery][pUserx] is useless so it's ok.
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

Offline Torio

  • LV3 Member (Next: 100)
  • ***
  • Posts: 83
  • Rating: +22/-0
    • View Profile
Re: Sprites and Maps in C 68k
« Reply #40 on: February 18, 2012, 09:00:12 am »
map[pUserX][pUserY] is useless but it will read the data out of the bounds, though. The simple fact of trying to read out of the bonds of the buffer can be naughty for the calculator.
Sorry about my mistakes, I'm French.

Projects :  Pokemon TI-89 | Ti-Tank

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Sprites and Maps in C 68k
« Reply #41 on: February 19, 2012, 03:19:23 am »
Note, if you decide to take on a Zelda project, you should probably make a small game as your first project to start with, since a larger Zelda would be a huge project if you are still beginning with C. My Zelda clone only had 3 dungeons and I had 3 years of experience in TI-BASIC when I made it.

It's nice to see you around again by the way :D (just make sure to not do the grammar police in the French section like in 2010, though :P). I thought you lost interest in calc-related stuff since you were not on TI-Planet/bank either.
« Last Edit: February 19, 2012, 03:27:28 am by DJ_O »

Offline Kiligolo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 218
  • Rating: +10/-1
    • View Profile
Re: Sprites and Maps in C 68k
« Reply #42 on: February 19, 2012, 03:32:44 am »
If he want, why not! Even if I learn C with this program, it can be a serious project if it works but now it's still a test game.
Zelda is a goal.
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

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Sprites and Maps in C 68k
« Reply #43 on: February 19, 2012, 03:55:08 am »
Ok that's good I guess.