Author Topic: [AXE] some puzzler thing i guess...?  (Read 7882 times)

0 Members and 1 Guest are viewing this topic.

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
[AXE] some puzzler thing i guess...?
« on: December 04, 2012, 02:58:01 pm »
Hi guys, i hope this project will be finished in a while, that would be my first project in axe...

as you can see in the gif the only thing i did for now is: tilemap, sprite, collision detection, and movement

Any ideas?

My code could probably be optimized a lot but idc XD but for the interested people: here it is anyways

EDIT: if someone has a better 8*8 sprite, i'dd appreciate it xD

EDIT 2 : this will be a game where in every level, or room or call it what you want, you will habe to solve a fun puzzle/riddle to continue to the next level (some levels will maybe be like : search something, so that will include multiple rooms, idk yet what to do with it, so gimme ideas ;p )

EDIT 3: Greyscale is for later, now it's b/w only
« Last Edit: December 04, 2012, 03:17:35 pm by stevon8ter »
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: [AXE] some puzzler thing i guess...?
« Reply #1 on: December 04, 2012, 03:32:28 pm »
At least this is a great learning project! I finished almost none of my projects (continuity *cough*<_<) but I learned a lot from doing all things. Hope you can get something nice out this though.
I'm not a nerd but I pretend:

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: [AXE] some puzzler thing i guess...?
« Reply #2 on: December 04, 2012, 03:35:48 pm »
Yeah i'll try to finish it but i'm not sure if it'll work, and yes sucky graphs and prolly gonna be slow but whatever, like you said, it's great for learning
« Last Edit: December 04, 2012, 03:36:04 pm by stevon8ter »
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: [AXE] some puzzler thing i guess...?
« Reply #3 on: December 04, 2012, 05:27:15 pm »
looking nice so far, that is nice and smooth movement :D

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: [AXE] some puzzler thing i guess...?
« Reply #4 on: December 04, 2012, 05:29:59 pm »
Thx ;)
I tried to do my best for my first axe program and it's the only way i could figure to do it...

Normal movement: x or y : 1-2lines
Movement+collision : 5lines xD
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: [AXE] some puzzler thing i guess...?
« Reply #5 on: December 04, 2012, 06:12:29 pm »
Here are a couple tips I could think of :P

Instead of sticking your tilemap drawing code inside the main loop (since you're not gonna be changing any tiles), you can stick it outside of the loop and StorePic to L3 (assuming you're willing to sacrifice that) and every loop through the main loop, just use RecallPic.

Also, for your collision routines, it's much easier to have a routine called GetT or something that returns the tile that a certain point is in. For instance, with your 8x8 tiles, you'd use:

Code: [Select]
Lbl GetT
Return {r2/8*12+(r1/8)+GDB0}

And since you're just checking for the empty ones, write another routine

Code: [Select]
Lbl CheckE
Return GetT(r1,r2)<1

or whatever. I've left it unoptimized for clarity - sometimes, this isn't the best way to do it, but it's good for many cases. That way you can rewrite

Code: [Select]
X-(getKey(2) and CheckE(X-1,Y) and CheckE(X-1,Y+7)) + (getKey(3) and CheckE(X+8,Y) and CheckE(X+8,Y+7))→X

Of course, there are much better ways to check for collisions, but I'll leave that as an exercise for you :D
In-progress: Graviter (...)

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: [AXE] some puzzler thing i guess...?
« Reply #6 on: December 04, 2012, 06:16:56 pm »
1) there will be things changing in maps :p
2) yeah ok fair point, but there will also be walkable paths so i'll just have to change the number...
3) hmmm i don't like pixeltest xD
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: [AXE] some puzzler thing i guess...?
« Reply #7 on: December 06, 2012, 10:49:04 am »

Instead of sticking your tilemap drawing code inside the main loop (since you're not gonna be changing any tiles), you can stick it outside of the loop and StorePic to L3 (assuming you're willing to sacrifice that) and every loop through the main loop, just use RecallPic.


Can this also be done with greyscale?
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: [AXE] some puzzler thing i guess...?
« Reply #8 on: December 06, 2012, 11:11:56 am »
you'd have to recall both the front and back buffers, and use other places in RAM/a temporary appvar to do the storing, so it would be annoying but doable.

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: [AXE] some puzzler thing i guess...?
« Reply #9 on: December 06, 2012, 11:12:42 am »
No; With greyscale, you'll likely have to add additional buffers or use L1. Of course, if you have a simple character like yours, you can just AND it off the frame before drawing it again the next frame, and then you won't have to redraw any part of the tilemap.
In-progress: Graviter (...)

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: [AXE] some puzzler thing i guess...?
« Reply #10 on: December 06, 2012, 11:14:13 am »
euhm, i don't really get it, could you please give a small example?

(already putted map routine outside main loop and now it's 2/3 times faster, thx ;)
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: [AXE] some puzzler thing i guess...?
« Reply #11 on: December 06, 2012, 11:16:48 am »
So what you can try doing is something like

Main loop
Your code
Pt-On(X,Y,Picwhatever)
DispGraph
Pt-Change(X,Y,Picwhatever)
End loop

That'll make sure your character is erased before the next frame, so you don't have to use RecallPic anymore.
In-progress: Graviter (...)

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: [AXE] some puzzler thing i guess...?
« Reply #12 on: December 06, 2012, 11:18:51 am »
So then i'll also won't have to Clear the draw anymore? and also no saving? And how does this display the greyscale? Just when mapping i do DispGraphr ?


EDIT: also, i noticed that MirageOs saves some variables, and that's rather anoying, as you can see in the gif is saves the "door"-open and the sprite face direction :/
How can i do that it doesn't save it?

Also: source added

EDIT: MirageOS settings added in gif (tho i don't want the user has to change something, it should preferably be done inside the program itself)

« Last Edit: December 06, 2012, 11:55:25 am by stevon8ter »
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: [AXE] some puzzler thing i guess...?
« Reply #13 on: December 06, 2012, 01:25:40 pm »
You need to use free RAM and not program variables. (i.e. use the bytes in L1 and don't store new values to your original map, say GDB0 or whatever)
In-progress: Graviter (...)

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [AXE] some puzzler thing i guess...?
« Reply #14 on: December 06, 2012, 01:33:19 pm »
This or you can set your variables at the beginning of your code. For example, if the door is open if A is 1, then type 0→A at the start of the program.