Archiverse Internet Archive
投稿のみ 投稿と返信
前のページ(最近)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
次のページ(過去)
プレイ日記
Stewart segludian1
I can't get the jumping right and it is probably still too long and complicated. But I think the simplified platformer is still pretty cool.
0そうだね
プレイ済み
返信[3]
親投稿
Stewart segludian1
8E7Y33G4 is the key for my guess the number program aimed at beginning programmers. It is full of comments (please excuse the type-os). Please give it a run and a read through and reply if that is too easy/hard/just right or if you have questions. Thanks, and good luck.
0そうだね
プレイ済み
返信[1]
親投稿
Stewart segludian1
You have two options, the first is to pack up everything into a big string. This can be simple like a comma separated value file or complicated... The problem with this approach is unpacking everything later. The other option is to put everything into an array and save load that. You are limited to a single data type however. I recommend you try this method. Save/Load demo attached.
2そうだね
プレイ済み
返信[14]
親投稿
Stewart segludian1
It might take me a while, and it may not be much simpler (you would still need most of the code), but I'll give it a try.
0そうだね
プレイ済み
返信[17]
親投稿
Stewart segludian1
SmileBasic has a built in map editor, but it is limited to a set size. Reading data from file can be difficult too. You could also create your own custom map editor and file format or just stuff the tiles you want in data statements. Hope that helps for backgrounds let me know if you have questions.
1そうだね
プレイ済み
返信[16]
親投稿
Stewart segludian1
on the bg layer is at the top left of the screen. You can also do things like rotate layers but try the basics out first. If you have scrolling you will probably want functions to map between background and screen coordinate and between tile and pixel coordinates. It can get confusing. Sprites unlike background tiles can be placed at a specific pixel coordinate on screen and move independently.
1そうだね
プレイ済み
返信[15]
親投稿
Stewart segludian1
layer's width and height. You use BGPUT layer_number, x, y, tile_id to put the tile tile_id at position x, and y on the layer. Note this is in tile coordinates not pixels by default. You can use BGGET layer_number, x, y, tile_val to read the tile at x, y on layer tile_layer and save it to the variable tile_val. You move layers around with BGOFS layer_number, x, y to move a layer around so x, y
1そうだね
プレイ済み
返信[14]
親投稿
Stewart segludian1
You can also change the width and height of layers. The layers can be moved around at a pixel level too. Doing so you can create scrolling. If you use multiple layers you can move them around at different rates to get parallax scrolling. To give a better illusion of depth. You get up to 4 layers of background between both of the 3DSs screens. BGSCREEN layer_number, width, height will setup the
1そうだね
プレイ済み
返信[13]
親投稿
Stewart segludian1
Lets talk about some background basics. Tilemap backgrounds in SmileBasic are surpisingly similar to the text mode character screen. The individual tiles are like a character except you get more colors and more of them. The tiles like a character can only be placed at certain locations on the grid, just like text. However unlike text you can have multiple layers (with trasparency).
1そうだね
プレイ済み
返信[7]
親投稿
Stewart segludian1
I use SPVAR to store information about an individual sprite (you only get 7 variables unfortunately). This would be information specific to a particular pedestrian. Line 19-25 is the sprite setup. Notice the SPFUNC call on line 24, and that the function name is in double quotes (that part threw me the first time). Lines 26-29 is the game loop with CALL SPRITE on line 27.
1そうだね
プレイ済み
返信[6]
親投稿
Stewart segludian1
Q34443GD has my samples folder. You want to look at SPFUNCDEMO which has a bunch of fruit bounce around the screen. Using SPFUNC you can set a callback function for a sprite. During your game loop call CALL SPRITE one per frame which will call all registered call back sprite functions. Lines 3-17 is a bounce function. When in a callback CALLIDX has your sprite's ID number.
1そうだね
プレイ済み
返信[5]
親投稿
Stewart segludian1
I would stay away from anything 3D. I also miss user defined types dearly. Being unable to move your code in/out or between 3DSs except for the severly limited and IP patrolled upload service nearly kills it. I want version control! That being said, I really like it and it is one of my favorite programs for 3DS. I just wish some of the arbitrary limits were removed.
1そうだね
プレイ済み
返信[6]
親投稿
Stewart segludian1
SPANIM [ID], "I", ["@LABEL"], 0 Will start the sprite animating. The 0 at the end says loop forever. [ID] Should be the id number of your sprite. "I" says use keyframe animation. Finally ["@LABEL"] will be the line to find your animation command. You will want to setup a state machine that calls each animation when required. Don't call one every frame that will just restart things over and over.
0そうだね
プレイ済み
返信[5]
親投稿
Stewart segludian1
Q34443GD is my samples folder look for a file in there called platform is is a basic Mario-ish game. You want to use spanim to animate your character. If you skip down to line 528 there are some data statements with example animations. First number is the number of frames. After that you have a pair of numbers per frame duration, and definition number.
0そうだね
プレイ済み
返信[38]
親投稿
Stewart segludian1
Regardless of a speed boost I like to include it. It documents your intent when using a variable so when you or someone else comes back to it after a break you have a better idea of what to do with it. For loop counters you almost always want %, for SIN and COS you want #. If you don't specify you may end up with a floating point number when you wanted an integer too. It pays to be precise.
2そうだね
プレイ済み
返信[37]
親投稿
Stewart segludian1
% means an integer variable. That is a whole number like 1, 0, or -1. While # means a floating point number that can have a value after the decimal point like -1.1, 3.14159, or 1.00001. Finally $ is for strings like say "Hello". Integers have a much smaller range, and can't have fractional values but are generally faster which on a low power computer may be useful.
2そうだね
プレイ済み
返信[30]
親投稿
Stewart segludian1
See how I used RESTORE to read the favorite numbers before the fruits even though the fruit was first in the code. RESTORE is the only reason we should use line numbers in smile basic. You declare data with the DATA statement after the statement is is just a comma separated list of numbers or strings which you can mix and match. READ just gets the next available data value
1そうだね
プレイ済み
返信[29]
親投稿
Stewart segludian1
END @FAV_FRUIT DATA 3 DATA "BANNANA" DATA "APPLE", "ORANGE" @FAV_NUMS DATA 4, 42, 13, 1, 100
1そうだね
プレイ済み
返信[28]
親投稿
Stewart segludian1
VAR I%, J%, FRUIT$, MAXNUM% PRINT "FAVORITE NUMBERS:" RESTORE @FAV_NUMS READ MAXNUM% FOR I% = 0 TO MAXNUM% - 1 READ J% PRINT J% NEXT I% PRINT "FAVORITE FRUITS:" RESTORE @FAV_FRUIT READ MAXNUM% FOR I% = 0 TO MAXNUM% - 1 READ FRUIT$ PRINT FRUIT$ NEXT I%
1そうだね
プレイ済み
返信[27]
親投稿
Stewart segludian1
If you want to control where is reads from you use RESTORE. If you don't pass a parameter it starts from the beginning. You can also pass a label to make it start at a certain spot in the code. You will need to be careful that you pass the correct variable to read, you don't want to try to put a string in a number variable.
1そうだね
プレイ済み