I'm having an issue with my RPG type game
I use a very basic sprite moving system but everytime i use spread i get a syntax error
@U
SPREAD(0)1,5
SPOFS 2,1,5
I'm having an issue with my RPG type game
I use a very basic sprite moving system but everytime i use spread i get a syntax error
@U
SPREAD(0)1,5
SPOFS 2,1,5
Here is my code
CLS
CLEAR
GCLS
SYSBEEP=0
LOAD ''BGU:SPRITE1'',0
SYSBEEP=1
SPSET 2,64,0,0,0,0,16,16
'---Movement
@MOVELOOP
IF BTRIG()==1 GOTO @U
IF BTRIG()==2 GOTO @D
IF BTRIG()==4 GOTO @L
IF BTRIG()==8 GOTO @R
GOTO @MOVELOOP
I'm having an issue with my RPG type game
I use a very basic sprite moving system but everytime i use spread i get a syntax error
@U
SPREAD(0)1,5
SPOFS 2,1,5
Here is my code
CLS
CLEAR
GCLS
SYSBEEP=0
LOAD ''BGU:SPRITE1'',0
SYSBEEP=1
SPSET 2,64,0,0,0,0,16,16
'---Movement
@MOVELOOP
IF BTRIG()==1 GOTO @U
IF BTRIG()==2 GOTO @D
IF BTRIG()==4 GOTO @L
IF BTRIG()==8 GOTO @R
GOTO @MOVELOOP
@U
SPREAD()1,5
SPOFS 2,1,5
To use Spread you must provide variables, not constants, after the ).
The values that the command gives will be stored in the variables you provide it with.
So everyone. I was talking to tobu and I spent a long time trying to explain to him how arrays and maps work.
He wants to make a game that has collision in it and he doesn't know where to start.
When I was finally about to give him the QR code he left mysteriously.
anyways I just thought I'd post it here since it might be able to help others who are struggling.
This little sample demonstrates the VERY rudimentary BASICS of tile based collision (WITHOUT using bgchk) http://imgur.com/KTvwfS3
Hopefully. It makes sense. if not. ask for help? I'm out of here now i have to sleep. :3 enjoy! and comment please let me know what you think (I know it's messy I whipped it up fast)
Got a project? PM ME on here!
Youtube: lostkitty64x
Want help with coding? PM ME! PM ME PM ME!! XD
FC: WIll post later.
Systems I own: ds lite, 3DS, PC/gaming, steam platform. I play alot of games. Just ask ! Minecraft anyone? :D
Here's a simple modification of the code I posted earlier for tobu ... but
Its supports a full who's tiles are (8 pixels by 8 pixels.). The map size is 32 by 24 tiles. So one screen maps. Oh yeah.. I forgot to do some multiplication in this one.
will update later... it wont work as intended now that I think of it :/ tired again
Wall=1
dirt=2
B=button()
if B==UP and player_y>1 and Map(area_num, player_x, player_y-1)>1 then gosub @moveup
if B==DOWN and player_y<24 and Map(area_num, player_x, Player_y+1)>1 then gosub @movedown
if B==LEFT and and player_x>1 Map(area_num, player_x, player_y-1)>1 then gosub @moveleft
if B==RIGHT and and player_x<32 Map(area_num, player_x, player_y)>1 then gosub @moveright
This code is meant to be an example ONLY. You can adapt it and use it but it isn't a full game engine.
What it is.. is a potential thing to build on to allow a person to create tradtional style 2D overhead games.. that use tile based collision and movement. t
these little systems can be quite fun to get you started programming some games! It should atleast render the map i made
if you get any read data statement errors let me know i probably messed up somewhere this isn't tested yet on pc
Also a note to everyone about this code. The reason it's written this way and not in a more efficient way is because I'm trying to make the way this works as blaringly obvious as I can to newbies. So I want as much as possible that I can have, in plain english. That's why the convert_area_num function is there to. Plus it allows me to do some fancy math later if i use this. This is meant to support multiple areas.
The total map size is 20, 20
The way it works is you get area_x and area_y
when you have all those arrays filled with your map data you can add in these commands
if B==UP and player_y<1 then player_y=24 and area_y=area_y-1
if B==DOWN and player_y>23 then player_y=1 and area_y=area_y+1
Something like that. Then you can call the function @convert_to_areanum
And it should automatically start using the other map plus your character will appear to have moved onto a different screen.
The bgput is reliable and it's fast, it'll fill up the screen with the tiles for the new area very quickly. So you shouldn't have issues.
If you CAN understand this. great job.
:3
Got a project? PM ME on here!
Youtube: lostkitty64x
Want help with coding? PM ME! PM ME PM ME!! XD
FC: WIll post later.
Systems I own: ds lite, 3DS, PC/gaming, steam platform. I play alot of games. Just ask ! Minecraft anyone? :D
Expect a decent boost in speed with this upcoming MM2 demo. While I had been re-developing it since the last demo, I tacked on a profiler that would tell me how many cycles I'd have left each frame. It worked, but it appeared that everything that was happening in the game looked to run about the same as it did on the September demo, and it slowed down quite a bit during areas where a lot of enemies were. Yesterday, I decided to remove it because I had planned to for the demo release, and lo and behold, the same areas where it was slowing down are not slowing down anymore (at least not nearly as much). I guess my profiler cutting into the next frame's cycles, giving an inaccurate reading and messing with everything. Looks like it's running much better than I expected.
I promised I'd make 3 random levels for the demo. The engine seems to be ready, and 2 levels are made. I'll be working on the last one today, and with any luck, the demo may see a release by tonight. If not today, then definitely next week.
edit: Scratch that.....1 level made. The tools I was using to make the levels screwed up, and when making the 3rd level, it overwrote the 2nd level I made.....I knew I should have made a copy before starting on the 3rd one.....
Well, I still have the idea of what the 2nd level was designed fresh in my mind, so I can remake it in less time than when I began it. Demo may be delay to next week......
Alright, now I will ask my question once more...
How do I make a proper main menu? I've printed the arrow for the scrolling but I can't figure out exactly how to animate to go up and down or select a certain piece of text and make that activate what it has to.
I feel like an absolute NOOB to this... I have so many questions...
@LOOP
IF Y<another# THEN Y==another#
IF Y>athird# THEN Y==athird#
LOCATE 2,another#RINT "SOME RANDOM MENU SEL STUFF"
LOCATE 2,athird#RINT "SOME MORE MEN SEL CRAP"
LOCATE 0,Y:PRINT ">":WAIT 4
GOTO @LOOP2
@LOOP2
IF BTRIG()==1 THEN Y=Y-1:GOTO @LOOP
IF BTRIG()==2 THEN Y=Y+1:GOTO @LOOP
IF BTRIG()==16 THEN ON Y-another# GOTO @LOOP3,@LOOP4
Vsync 1
GOTO @LOOP2
Alright, now I will ask my question once more...
How do I make a proper main menu? I've printed the arrow for the scrolling but I can't figure out exactly how to animate to go up and down or select a certain piece of text and make that activate what it has to.
I feel like an absolute NOOB to this... I have so many questions...
@LOOP
IF Y<another# THEN Y==another#
IF Y>athird# THEN Y==athird#
LOCATE 2,another#RINT "SOME RANDOM MENU SEL STUFF"
LOCATE 2,athird#RINT "SOME MORE MEN SEL CRAP"
LOCATE 0,Y:PRINT ">":WAIT 4
GOTO @LOOP2
@LOOP2
IF BTRIG()==1 THEN Y=Y-1:GOTO @LOOP
IF BTRIG()==2 THEN Y=Y+1:GOTO @LOOP
IF BTRIG()==16 THEN ON Y-another# GOTO @LOOP3,@LOOP4
Vsync 1
GOTO @LOOP2
Syntax Error (10,IF)
Here's an error sir.
I use this setup on all my menu ststems. You entered it wrong.
I just put a link in QR Sharing thread. It's a witch game. I made it because there was a lot of interest in learning how to use SPRITE command. I decided to just make a sample game that has high SPRITE coefficient ratio.
I hope you download it and study it. If you have any questions about it, feel free to ask. Read the HELP screen first.
It's a WITCH game, but feel free to change it all around. I put in a minimal gameplay in it. Feel free to change that too.
Forums
Topic: Petit Computer
Posts 4,181 to 4,200 of 9,618
Sorry, this topic has been locked.