Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
22 May, 2013, 23:04:01 *
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 ... 33 34 [35] 36   Go Down
  Print  
Author Topic: Your Projects - Post and Critique -  (Read 32074 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
XVicarious
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 15 April, 2013, 12:25:41
Date Registered: 04 January, 2011, 04:04:27
Location: 127.0.0.1
Posts: 456


Total Post Ratings: +17

View Profile WWW
« Reply #510 on: 15 January, 2011, 01:50:33 »
0

Yeah. I remember reading about pointers in C++, but never really had the chance to use them. And fyi I edited my previous post here.
Logged







Spoiler for Countries:


Michael_Lee
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: 09 August, 2012, 18:48:39
Date Registered: 05 August, 2010, 01:00:06
Posts: 1020

Total Post Ratings: +115

View Profile
« Reply #511 on: 15 January, 2011, 01:56:07 »
0

Collision checking?  Do you mean making sure enemies never intersect?

If we keep the amount of enemies fairly low (under a hundred, probably), then you could just take a brute force method - randomly generate two numbers for X and Y coordinates, check those numbers against every other enemy's coordinates, then if the absolute difference is 7 or less, then either attempt select another random slot, or add/subtract the appropriate amount of numbers to get the enemies not to intersect.

Edit: You probably meant bullets - in that case, just use the same checks you did with variables, only because all of your data is in what is effectively a list, do the checks in a for loop.
« Last Edit: 15 January, 2011, 02:01:13 by Michael_Lee » Logged

My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.
Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Yesterday at 02:03:21
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022


Topic starter
Total Post Ratings: +1019

View Profile
« Reply #512 on: 15 January, 2011, 02:32:39 »
0

Also, what Michael_Lee has shown you is accessing bytes in ram using pointers ex: {L1+5}.  However, bytes only allow you values between 0-255 (or -128 to 127 if you sign extend them with "sign{").  That's fine if this is just a "Screen X" and "Screen Y" since the numbers will never get that big anyway.  But if you need numbers that go higher than that, you have to use words which are 2 byte numbers.  This is how the regular Axe variables work.  That gives you values between 0-65535 which is much larger.  All you have to do to use them is add an r to the end of the closing bracket ex: {L1+5}r  That would use both bytes {L1+5} and {L1+6} to hold the 2 byte number.
Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
XVicarious
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 15 April, 2013, 12:25:41
Date Registered: 04 January, 2011, 04:04:27
Location: 127.0.0.1
Posts: 456


Total Post Ratings: +17

View Profile WWW
« Reply #513 on: 15 January, 2011, 02:56:16 »
0

Collision checking?  Do you mean making sure enemies never intersect?

If we keep the amount of enemies fairly low (under a hundred, probably), then you could just take a brute force method - randomly generate two numbers for X and Y coordinates, check those numbers against every other enemy's coordinates, then if the absolute difference is 7 or less, then either attempt select another random slot, or add/subtract the appropriate amount of numbers to get the enemies not to intersect.

Edit: You probably meant bullets - in that case, just use the same checks you did with variables, only because all of your data is in what is effectively a list, do the checks in a for loop.

So since my current check is

1
If ((A-4<=X)and(A+4>=X))and(B=Y)
i can just replace the variables I use for the enemy, with the loop, correct?
Logged







Spoiler for Countries:


Binder News
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: 13 May, 2013, 22:50:58
Date Registered: 26 October, 2010, 22:05:05
Location: In a pit on an island somewhere in the Atlantic.
Posts: 779


Total Post Ratings: +43

View Profile
« Reply #514 on: 15 January, 2011, 02:58:22 »
0

Yep, I think. (I didn't read the rest of this)
Logged

Spoiler for userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler for Test Results:




XVicarious
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 15 April, 2013, 12:25:41
Date Registered: 04 January, 2011, 04:04:27
Location: 127.0.0.1
Posts: 456


Total Post Ratings: +17

View Profile WWW
« Reply #515 on: 15 January, 2011, 03:37:29 »
0

Ahh Crazy! I used the code for the Pt-On() and it displays one of those like messed up sprite things when you do something wrong lol. I had to modify the variables a tad, and made sure that i fixed all of them properly but still it happens!  Frustrated

And I'm about to create a topic for this, so I'll link that in an edit so we don't spam up this topic too much.
Logged







Spoiler for Countries:


tincopper2
LV1 Newcomer (Next: 20)
*
Offline Offline

Last Login: 22 January, 2013, 08:29:32
Date Registered: 07 November, 2012, 23:50:30
Posts: 6

Total Post Ratings: 0

View Profile
« Reply #516 on: 08 November, 2012, 00:02:26 »
0

Here's what I worked on for the past two days.  It's a 16 by 16 smoothscrolling movement engine.  Let me know what you think! Grin

I also wrote a little Pic to Hex program.  Put the top left corner of the sprite in the top left corner of the graphscreen.  Then set 0 (for 8*8 ) or 1 (for 16*16 ) to T on the first line of the program and run it.  I used it to give me the 16*16 hex codes that I used in the movement engine. Smiley
@ztrumpet , How did you get the sprites to be 16x16? When I store a value into hex I only know how to do 8x8... but I can
pt-On(x,y,A)
pt-On(x+8,y,B)
pt-On(x,y+8,C)
pt-On(x+8,y+8,D)
Which essentially uses 4 sprites just to make one which feels like a waste... Is there a way to put this into one sprite?
Logged
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: Today at 22:30:19
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50221


Total Post Ratings: +2615

View Profile WWW
« Reply #517 on: 08 November, 2012, 00:03:56 »
0

You can use the Bitmap function, but I think it's even slower because the routine is written by Texas Instruments and is not as optimized.

Also welcome here Smiley , sadly ztrumpet isn't around anymore so if you need more details from an Axe expert you might have to wait for someone else's answer.
« Last Edit: 08 November, 2012, 00:04:38 by DJ_O » Logged

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

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
squidgetx
Food.
Coder Of Tomorrow
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 18:24:17
Date Registered: 30 May, 2010, 19:54:18
Location: eating somewhere
Posts: 1831


Total Post Ratings: +477

View Profile
« Reply #518 on: 08 November, 2012, 00:04:35 »
0

Woah, necro! (sort of)

Welcome to the forums, tincopper2.

I'm not ztrumpet, but I can tell you that if you want to use 16x16 sprites in pure Axe, you'll have to use 4 8x8 sprites...that's the only way to do it without an Axiom or assembly coding. (or, as dj mentioned, you can use the bitmap command but that sucks if you want to get any kind of reasonable speed)

There are probably quite a few 16x16 sprite routines floating around in assembly, you could probably find one relatively easily (although if you want clipping that's a different story...)
« Last Edit: 08 November, 2012, 00:06:51 by squidgetx » Logged

Read my webcomic! | My SoundCloud
Projects:

Check out the demo now!- Current progress: battle engine and stuff
Proud author of: Cuberunner | SpaceDash | The Psyche | XXEdit | AxeSynth | StickNinja | Gravity Guy | Embers:Phoenix | Zombie Gun
Axe: Need help optimizing?
User of Axe | zStart | TokenIDE | CalcGS | MirageOS
tincopper2
LV1 Newcomer (Next: 20)
*
Offline Offline

Last Login: 22 January, 2013, 08:29:32
Date Registered: 07 November, 2012, 23:50:30
Posts: 6

Total Post Ratings: 0

View Profile
« Reply #519 on: 08 November, 2012, 00:18:39 »
0

Woah, necro! (sort of)

Welcome to the forums, tincopper2.

I'm not ztrumpet, but I can tell you that if you want to use 16x16 sprites in pure Axe, you'll have to use 4 8x8 sprites...that's the only way to do it without an Axiom or assembly coding. (or, as dj mentioned, you can use the bitmap command but that sucks if you want to get any kind of reasonable speed)

There are probably quite a few 16x16 sprite routines floating around in assembly, you could probably find one relatively easily (although if you want clipping that's a different story...)
Holy mackeral! Fast reply! Btw, thanks.
Logged
Builderboy
Physics Guru
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Today at 21:33:02
Date Registered: 20 April, 2009, 00:28:53
Location: Ravenholm
Posts: 5642


Total Post Ratings: +589

View Profile
« Reply #520 on: 08 November, 2012, 01:00:47 »
0

You can use the Bitmap function, but I think it's even slower because the routine is written by Texas Instruments and is not as optimized.

Actually Axe got a new bitmap routine written for it that is much more functional and super fast Cheesy I know if it is better than using 4 sprite calls, but it is nice and speedy if you have even larger moving images ^^
Logged

squidgetx
Food.
Coder Of Tomorrow
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 18:24:17
Date Registered: 30 May, 2010, 19:54:18
Location: eating somewhere
Posts: 1831


Total Post Ratings: +477

View Profile
« Reply #521 on: 08 November, 2012, 03:20:29 »
0

Oh nice Cheesy

Note that the bitmap Y offset might be kinda weird (at least in my experience it's about 3 px off )

Edit: Never mind, that *shouldn't* be a problem
« Last Edit: 08 November, 2012, 03:39:52 by squidgetx » Logged

Read my webcomic! | My SoundCloud
Projects:

Check out the demo now!- Current progress: battle engine and stuff
Proud author of: Cuberunner | SpaceDash | The Psyche | XXEdit | AxeSynth | StickNinja | Gravity Guy | Embers:Phoenix | Zombie Gun
Axe: Need help optimizing?
User of Axe | zStart | TokenIDE | CalcGS | MirageOS
GinDiamond
LV1 Newcomer (Next: 20)
*
Offline Offline

Last Login: 08 February, 2013, 00:40:58
Date Registered: 09 November, 2012, 00:23:32
Posts: 13

Total Post Ratings: 0

View Profile
« Reply #522 on: 26 November, 2012, 21:35:19 »
0

I'm working on a roguelike game in Axe. Here's the current code (its really just an @ sign moving around at this point):


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.MAZEGAME
#ExprOn
DiagnosticOff
[3C409EA2A29E423C]->Pic1
ClrHome
0->X->Y
Repeat getKey(15)
If getKey(4)?Y>0
Y--
ElseIf getKey(1)?Y<56
Y++
ElseIf getKey(2)?X>0
X--
ElseIf getKey(3)?X<88
X++
End
Lbl DP
ClrDraw
Pt-On(X,Y,Pic1)
DispGraph
End
Return

How would I add walls/floor tiles? Like:

1
2
3
4
5
6
7
8
9
10
11
12
################
#..............#
#..............#
#..............#
#..............#
#..............#
#..............#
#..............#
#..............#
#..............#
################

Any help please? Thanks!
Logged
Darl181
Vy'o'us pleorsdtu tlh'e gjaemue.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Online Online

Gender: Male
Last Login: Today at 22:48:25
Date Registered: 10 June, 2010, 00:32:08
Location: {I*9+L₁+1},{I*9+L₁+3}
Posts: 3279


Total Post Ratings: +267

View Profile WWW
« Reply #523 on: 26 November, 2012, 22:50:57 »
0

You'll want to do a tilemap. The tiles themselves are sprites.
For the sprites you'll want a sprite editor. There's a ton of those around here, take your pick Tongue
Tilemaps are kind of complicated if you're new to programming, but you can have a look around the tutorials and feel free to ask for help Smiley
Logged




 
Spoiler for Stuff:



OS 2.43  Boot 1.02  Hardware Rev. B

OS 1.04.32

OS 3.1.0.392  Boot1 3.0.99  Boot2 3.10.16
Spoiler for Misc:
Quote
You'll understand / It's not a shame / To be always / Losing the game / Burma-Shave
"Dynamic userbars!"
Omnimaga radio
Interactive Omnimaga radio
Our World of Text
Draw on websites
Then blow them up
In-browser flight simulator
Haxball: MMO soccer/air hockey game
  Draw with sand.  Yay?
The Game
You just lost the game
Zombo.com
light post color is #dfefff
dark post color is #cae4ff
quote box color is #6699ff
transparent color is...transparent 0.o
Spoiler for Forum search alternative (bookmarklet):
https://www.squarefree.com/bookmarklets/search.html
javascript:q=""+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);if(!q)q=prompt("No%20selected%20text;%20enter%20search%20term.").replace(/\s\+/g,"%252B");if(q!=null)location="http://www.google.com/search?q="+q.replace(/\s+/g,"+")+"+site:"+location.hostname;void(0);
GinDiamond
LV1 Newcomer (Next: 20)
*
Offline Offline

Last Login: 08 February, 2013, 00:40:58
Date Registered: 09 November, 2012, 00:23:32
Posts: 13

Total Post Ratings: 0

View Profile
« Reply #524 on: 26 November, 2012, 23:08:24 »
0

Thanks, Darl181!

Could I make a matrix and then somehow make certain sprites (Pic2 would be wall tiles, Pic3 would be floor tiles) print to the screen according to the matrix?
Logged
Pages: 1 ... 33 34 [35] 36   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.403 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.