Author Topic: [C] SpeedX 3D reaches your Nspire !  (Read 33828 times)

0 Members and 1 Guest are viewing this topic.

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: [C] SpeedX 3D reach your Nspire !
« Reply #15 on: October 06, 2012, 12:08:16 pm »
hmmm, i should try porting this to LuaFX and LuaZM...



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [C] SpeedX 3D reach your Nspire !
« Reply #16 on: October 06, 2012, 12:31:55 pm »
It'll be very hard in fact :/ I first did it in Lua, in a proof of concept, and it ran at 0.125 FPS ^^'
« Last Edit: October 06, 2012, 12:32:21 pm by Matrefeytontias »

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: [C] SpeedX 3D reach your Nspire !
« Reply #17 on: October 06, 2012, 02:59:30 pm »
How does your 3D routine work?

I thought I would do it like this:

1. draw lines.
2. draw circles.
3. draw obstacles.
4. collision detection

I would not be making it really 3D, it would be pseudo 3D.



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [C] SpeedX 3D reach your Nspire !
« Reply #18 on: October 06, 2012, 03:46:22 pm »
It's pseudo-3D based on angles and depths. I followed this tutorial by Ben Ryves, but it appears that several concepts are wrongs (like the calculation of the depth, he use a really weird way to do this and I had a hard time to make it work).

You can of course ask questions if you're in trouble :)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [C] SpeedX 3D reach your Nspire !
« Reply #19 on: October 06, 2012, 05:07:24 pm »
As I said, for now it's only for non-CX calcs -> no colors D:
Are you planning CX support in the near future, though? Because non-CX calcs are getting harder and harder to find in stores so your game would probably get fewer and fewer interest with the time. D:

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [C] SpeedX 3D reach your Nspire !
« Reply #20 on: October 07, 2012, 02:27:06 am »
Yeah, of course I planned to adapt it for CX calcs ;) I even planned to make it with colors.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: [C] SpeedX 3D reach your Nspire !
« Reply #21 on: October 07, 2012, 02:43:46 am »
Looking great! :D

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [C] SpeedX 3D reach your Nspire !
« Reply #22 on: October 07, 2012, 03:26:09 am »
Small update :)

In fact I just moved the origin up to make the player run on the ground instead of fly at the middle of the tunnel. And I also changed the texture so it looks better on-calc, even if it's worse on an emulator.



Also, the screen is taken by a Ti-Nspire CX CAS emulator :D
« Last Edit: October 07, 2012, 03:27:16 am by Matrefeytontias »

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [C] SpeedX 3D reach your Nspire !
« Reply #23 on: October 08, 2012, 01:32:53 pm »
Up !

I'm having trouble with srand() ... If I try to use it, the program crashes without saying anything. Here is the way I use it :
Code: [Select]
int ... , *initRand = 0x90090000;      // IRQ timer location

// mallocs here

srand(*initRand);
I think that the program crashes here.

Idea anyone ?

Offline lkj

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 485
  • Rating: +58/-1
    • View Profile
Re: [C] SpeedX 3D reach your Nspire !
« Reply #24 on: October 08, 2012, 02:07:36 pm »
This syscall doesn't work in the current ndless revision also for other people :-\ You might have to implement a random number function yourself.
« Last Edit: October 08, 2012, 02:08:08 pm by lkj »

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [C] SpeedX 3D reach your Nspire !
« Reply #25 on: October 08, 2012, 02:31:08 pm »
That's weird, I've already done a program using this func and it worked perfectly (but maybe it's thanks to nSDL ...).

Offline lkj

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 485
  • Rating: +58/-1
    • View Profile
Re: [C] SpeedX 3D reach your Nspire !
« Reply #26 on: October 08, 2012, 03:35:15 pm »
It works on cx, but not on classic nspires.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [C] SpeedX 3D reach your Nspire !
« Reply #27 on: October 08, 2012, 03:37:24 pm »
SpeedX doesn't work on anything, and my others works on both ???

Offline lkj

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 485
  • Rating: +58/-1
    • View Profile
Re: [C] SpeedX 3D reach your Nspire !
« Reply #28 on: October 08, 2012, 03:45:37 pm »
Then just implement your own rand function, for example
Code: [Select]
static unsigned x;

void sxorrand(unsigned seed){
    x = seed;
}

unsigned xorrand() {
  x ^= x << 13;
  x ^= x >> 17;
  x ^= x << 5;
  return x;
}

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [C] SpeedX 3D reach your Nspire !
« Reply #29 on: October 08, 2012, 03:50:09 pm »
Yeah, good idea, I'll use it. Thanks a lot :)