* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: This Is The Only Level +CE  (Read 11356 times)

0 Members and 1 Guest are viewing this topic.

Offline xlibman

  • Omni founder & CW co-founder
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18727
  • Post Rating Ratio: +95/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: This Is The Only Level +CE
« Reply #15 on: September 12, 2016, 11:44:28 pm »
Glad to see progress JWinslow23. Also I like that color scheme better. :)
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline MateoConLechuga

  • Full User
  • Join Date: Jan 2015
  • Location:
  • Posts: 227
  • Post Rating Ratio: +21/-1
Re: This Is The Only Level +CE
« Reply #16 on: September 12, 2016, 11:47:57 pm »
Glad to see progress JWinslow23. Also I like that color scheme better. :)
I believe the color scheme is randomly generated each time :)

Offline xlibman

  • Omni founder & CW co-founder
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18727
  • Post Rating Ratio: +95/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: This Is The Only Level +CE
« Reply #17 on: September 13, 2016, 08:04:24 am »
Oh, I thought it was fixed. I guess I got too used at the grayscale version :P
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline JWinslow23

  • Pi is the coolest number in the history of math. :\
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and Graham's Number
  • Posts: 750
  • Post Rating Ratio: +10/-1
  • Use pi! Pi is the absolute greatest! :(
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
Re: This Is The Only Level +CE
« Reply #18 on: September 13, 2016, 11:50:47 am »
Oh, I thought it was fixed. I guess I got too used at the grayscale version :P
It's kinda weird to me to make a port of a game and have people play that more than the original. :P

Offline xlibman

  • Omni founder & CW co-founder
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18727
  • Post Rating Ratio: +95/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: This Is The Only Level +CE
« Reply #19 on: September 13, 2016, 05:01:14 pm »
Lol that's because I am still quite into calc games. :P

  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline JWinslow23

  • Pi is the coolest number in the history of math. :\
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and Graham's Number
  • Posts: 750
  • Post Rating Ratio: +10/-1
  • Use pi! Pi is the absolute greatest! :(
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
Re: This Is The Only Level +CE
« Reply #20 on: September 13, 2016, 11:59:03 pm »
I'm having a small problem with jumping. When the elephant hits the ground, his y-position (a float) needs to be a multiple of 11 plus a constant offset. I know how to check for when he hits the ground, but how, in code, would I make sure his y-position is a multiple of 11 plus a constant offset?

The y-position is a double with name player_y, and the constant offset is a defined integer with name TILEMAP_Y_OFFSET.

Offline MateoConLechuga

  • Full User
  • Join Date: Jan 2015
  • Location:
  • Posts: 227
  • Post Rating Ratio: +21/-1
Re: This Is The Only Level +CE
« Reply #21 on: September 14, 2016, 12:30:17 am »
Use the modulus operator (%)

Offline JWinslow23

  • Pi is the coolest number in the history of math. :\
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and Graham's Number
  • Posts: 750
  • Post Rating Ratio: +10/-1
  • Use pi! Pi is the absolute greatest! :(
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
Re: This Is The Only Level +CE
« Reply #22 on: September 14, 2016, 12:35:47 am »
Not working. Apparently you can't do a modulus operator to a double.

EDIT: Also, the Y-position being a double is causing problems elsewhere. I think I need help with datatypes.

The Y-velocity needs to be a double, but I'm not sure about the Y-position.

EDIT AGAIN: Code is attached.


I am freaking stupid.

Offline xlibman

  • Omni founder & CW co-founder
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18727
  • Post Rating Ratio: +95/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: This Is The Only Level +CE
« Reply #23 on: September 14, 2016, 05:33:07 am »
How is the speed so far?
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline JWinslow23

  • Pi is the coolest number in the history of math. :\
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and Graham's Number
  • Posts: 750
  • Post Rating Ratio: +10/-1
  • Use pi! Pi is the absolute greatest! :(
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
Re: This Is The Only Level +CE
« Reply #24 on: September 14, 2016, 05:44:22 am »
How is the speed so far?
Very playable. The screenshot is slow for some reason, I blame Cemu.



Also, new version!

It adds jumping, gravity, a little bounce mechanic, and death! It also adds a placeholder for where a timer will be, if I can figure out how to time to the 100th of a second.

Download attached.

Offline Juju

  • aka Yuki Kagayaki aka J̵̭͕͇ù̞̭̝̯̦j̴̭̙̗͖͡ù͏͓̲̕
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Moderator
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Inside a walrus
  • Posts: 3077
  • Post Rating Ratio: +30/-2
  • Couch potato
    • jul.savard
    • juju2143
    • @juju2143
    • juju2143
    • @julosoft
    • juju-kun
    • /u/juju2143
    • juju2143
    • @juju2143
    • Juju's shed
  • Gender: Female
  • WalriiPoints: 99999
Re: This Is The Only Level +CE
« Reply #25 on: September 14, 2016, 06:04:41 am »
Ooooh, I like this.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
On semi-hiatus until who knows when. CODEWALRUS 2.0 COMING SOON
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Offline MateoConLechuga

  • Full User
  • Join Date: Jan 2015
  • Location:
  • Posts: 227
  • Post Rating Ratio: +21/-1
Re: This Is The Only Level +CE
« Reply #26 on: September 14, 2016, 06:46:06 am »
Here's an optimized version of hit_block: (I also changed the inputs to uint8_t)

Code: [Select]
bool hit_block( uint8_t hit_x, uint8_t hit_y, uint8_t block_hit ) {
uint8_t x_off1 = (hit_x - TILEMAP_X_OFFSET) / TILE_WIDTH;
uint8_t x_off2 = (hit_x + TILE_WIDTH  - TILEMAP_X_OFFSET - 1) / TILE_WIDTH;
uint8_t y_off1 = (hit_y - TILEMAP_Y_OFFSET) / TILE_HEIGHT;
uint8_t y_off2 = (hit_y + TILE_HEIGHT - TILEMAP_Y_OFFSET - 1) / TILE_HEIGHT;

return (collision( x_off1, y_off1 ) == block_hit) ||
(collision( x_off1, y_off2 ) == block_hit) ||
(collision( x_off2, y_off1 ) == block_hit) ||
(collision( x_off2, y_off2 ) == block_hit) ;
}

Notice that in code; if you have loops and stuff, it repeats that code every single time. Better to just store the computations and then use them I guess.

Offline JWinslow23

  • Pi is the coolest number in the history of math. :\
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and Graham's Number
  • Posts: 750
  • Post Rating Ratio: +10/-1
  • Use pi! Pi is the absolute greatest! :(
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
Re: This Is The Only Level +CE
« Reply #27 on: September 14, 2016, 11:50:41 am »
Here's an optimized version of hit_block: (I also changed the inputs to uint8_t)

Code: [Select]
bool hit_block( uint8_t hit_x, uint8_t hit_y, uint8_t block_hit ) {
uint8_t x_off1 = (hit_x - TILEMAP_X_OFFSET) / TILE_WIDTH;
uint8_t x_off2 = (hit_x + TILE_WIDTH  - TILEMAP_X_OFFSET - 1) / TILE_WIDTH;
uint8_t y_off1 = (hit_y - TILEMAP_Y_OFFSET) / TILE_HEIGHT;
uint8_t y_off2 = (hit_y + TILE_HEIGHT - TILEMAP_Y_OFFSET - 1) / TILE_HEIGHT;

return (collision( x_off1, y_off1 ) == block_hit) ||
(collision( x_off1, y_off2 ) == block_hit) ||
(collision( x_off2, y_off1 ) == block_hit) ||
(collision( x_off2, y_off2 ) == block_hit) ;
}

Notice that in code; if you have loops and stuff, it repeats that code every single time. Better to just store the computations and then use them I guess.
Do you think that the inputs ought to be uint8_t's? Those are the literal coordinates of the guy on-screen, which doesn't take those.

Offline MateoConLechuga

  • Full User
  • Join Date: Jan 2015
  • Location:
  • Posts: 227
  • Post Rating Ratio: +21/-1
Re: This Is The Only Level +CE
« Reply #28 on: September 14, 2016, 01:40:06 pm »
Haha, oops, yeah. Well, the y value can be, but the x value should be a uint24_t :P The rest is fine.

Offline JWinslow23

  • Pi is the coolest number in the history of math. :\
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and Graham's Number
  • Posts: 750
  • Post Rating Ratio: +10/-1
  • Use pi! Pi is the absolute greatest! :(
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
Re: This Is The Only Level +CE
« Reply #29 on: September 14, 2016, 06:41:19 pm »
Haha, oops, yeah. Well, the y value can be, but the x value should be a uint24_t :P The rest is fine.
Alright, thanks!

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games