Forums

Topic: Petit Computer

Posts 4,181 to 4,200 of 9,618

SmokedSausage

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

Hi, I'm SmokedSausage and i like meemoos :^)

X:

SmokedSausage

Hansausage wrote:

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

Hi, I'm SmokedSausage and i like meemoos :^)

X:

Eel

Hansausage wrote:

Hansausage wrote:

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.

Bloop.

<My slightly less dead youtube channel>

SMM2 Maker ID: 69R-F81-NLG

My Nintendo: Abgarok

SmokedSausage

Still working on my RPG still no name but i have decided to make it alot like Final Fantasy as i don't see many Petit Computer games like it.

Hi, I'm SmokedSausage and i like meemoos :^)

X:

Gimmemorecoinz

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

Gimmemorecoinz

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

UP=1
DOWN=2
LEFT=4
RIGHT=8

dim map(400, 32, 24)
dim areas(20, 20)

'define the X and Y for our areas

area_x=0
area_y=0
player_x=10
player_y=10

area_to_load=0
gosub @loadmap1

Spset 0, 128, 0, 0, 0, 0

@main
spofs 0, player_x, player_y, 5

gosub @convert_to_areanum
gosub @drawmap

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

vsync 2

goto @main

@convert_to_areanum
area_num=floor(area_y*20+area_x)

return

@loadmap1

for tempx=0 to 31
for tempy=0 to 23

read map(area_to_load, tempx, tempy)

next tempy
next tempx

return

@moveup
player_y=player_y-1
return

@movedown
player_y=player_y+1
return

@moveleft
player_x=player_x-1
return

@moveright
player_x=player_x+1

return

@drawmap

''draw out the map
for tempx=1 to 32
for tempy=1 to 24

thistile=map(area_num, tempx, tempy)

if thistile==wall then bgput 0, tempx, tempy,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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
data 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
data 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
data 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1

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

[Edited by Gimmemorecoinz]

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

SmokedSausage

@Slayer Thanks i'll check the link later but i'm not working on a full clone. Just a simple FF type game. It's kinda meant to be a test.

Hi, I'm SmokedSausage and i like meemoos :^)

X:

Discostew

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......

[Edited by Discostew]

Discostew

Switch Friend Code: SW-6473-2521-3817

Slayer

@IAmAPerson do you actually PLAY Minecraft?

I have nothing really to say about myself.

Slayer

I have Minecraft open as I type these...

I have nothing really to say about myself.

Slayer

swordx wrote:

slayer wrote:

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 have nothing really to say about myself.

swordx

slayer wrote:

swordx wrote:

slayer wrote:

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.

swordx

damolii

Hansausage wrote:

Still working on my RPG still no name but i have decided to make it alot like Final Fantasy as i don't see many Petit Computer games like it.

I'm making an RPG.... ._.

I don't have a 3DS so what do I put here? -Damolii

ramstrong

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.

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

Discostew

I'd be lying if I said I hadn't thought about remaking FFIV after making MM2 PTC.

[Edited by Discostew]

Discostew

Switch Friend Code: SW-6473-2521-3817

Eel

Discostew wrote:

I'd be lying if I said I hadn't thought about remaking FFIV after making MM2 PTC.

Now that you mentioned that here, it makes it official!

Petit Fantasy IV- coming soon from the creator of MM2 PTC.

Bloop.

<My slightly less dead youtube channel>

SMM2 Maker ID: 69R-F81-NLG

My Nintendo: Abgarok

Sorry, this topic has been locked.