Okay everyone. Because I was having issues with coding inside of PTCutilities but I really want to code on a pc not on my 3DS
I took the time to use the dialougue box of notepad++ to create a custom language highlighting. It is incomplete but functional.
Here it is on the wiki page http://petitcomputer.wikia.com/wiki/Notepad%2B%2B_highlightin...
This may help users spot errors more easily inside of petit computer code because of how the code is broken up and categorized.
Enjoy! Sprite commands haven't been added yet but most other "key" commands that beginners use, have been.
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
Hey everyone. Your going to be surprised.. and maybe a bit confused.
I've created some example template code in order to handle typed arrays.
It supports up to 150 custom user defined types, each type can have up to 150 seperate instances
and each instance can have up to 10 custom named local variables, and each instance's local variables can hold up to ten local values
there is no @set function but you can make one yourself.
Here is the code. If your confused about what's going on ask me. I can try to explain it
NOTE: Not something for newbies to try using. though your welcome to it.
Typed array system template by GimmeMoreCoinz
'by GimmeMoreCoinz
'First we define our data types
'and a system for typed arrays
'constant is
dim localtype_values(10)
dim localtype_valnames$(10)
local_type_name$=""
local_type_index=0
local_type_instance=0
dim typenames$(150)
dim typeinstance_types(150, 150) '150 instances of each type allowed. The value of "this" instance will index the name of this type.
dim type_variable_names$(150, 10)
dim type_instance_variables(150, 150, 10) '150 different user defined types. 150 unique instances of each type, 10 different variables to each type
for temp=1 to 150
for temp2=1 to 150
for instance_vars=1 to 10
''perform testing on the values
local_type_instance=instance_vars
index1=temp1
index2=temp2
gosub @get_type_values
local_type_values(instance_vars)=localvar
next getvarproperties
'put your code here to handle the type values
if local_type_index==1 'this object is say, a specific sprite
if local_type_index==2 'this object is something else
'you would have to code a @set_type_values after all of this, if you change the local variables
'but basically this allows you to keep the specific values of the current object in memory while you branch to handle it based on it's "type"
'and you can safefely assume in your branching that if local_type_name$=="Bomb_sprite" then gosub @handlebombsprite or something like that.
'I know this is a complex system but it just allows you to create more dynamic programs. :3
@get_type_values 'this function will put the local values of this type into memory
local_type_index=typeinstances_types(index1, index2)
local_type_name$=typenames$(local_type_index, local_type_instance)
localvar=type_instance_variables(index1, index2, instance_vars)
return
This is similiar to using accesors or class members in higherlevel languages such as
bikeclass bike1;
bike1.pedal_speed=10
Except that access code would be longer in BASIC
it would be more like
type_names$(1)="bike"
type_variable_names$(1, 1)="pedal_speed"
type_instance_variables(150, thisinstance, 1)=10 "fast
'thisinstance is 1 out of 10 copies of the class named Bike.
'you could call it thisbike to be less confusing
This is the same as in C++ going
mybikeclass bike_1
bike_1.pedal_speed=10
I hope this makes sense
the reason there are only 150 type names is because you can only have 150 unique type names
and the reason there are (150, 150, 10) for the other things (var names and variable values)
is because you can have up to 150 , OF 150 of each unique type.
So you can have 150 unique "types" and 150 copies of EACH unique type
and each unique type has 150 values for the name of it's variables
and 150 unique values for it's 10 non unique variables
I hope this makes some sense to the more experienced programmers ;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
I could use loads of labels or have a loop that just reads the data into nowhere until it hits the offset and then start actually reading the data but both are a bit wasteful in their own ways.
I could use loads of labels or have a loop that just reads the data into nowhere until it hits the offset and then start actually reading the data but both are a bit wasteful in their own ways.
This specific code has not been tested yet, as I always use double dimention arrays with DATA, so let me know if there are any problems.
Oh and btw if you get a "undefined array" or similar error, just put DIM ArrayThatYouAreUsing(Number of "slots" useable in this array (you can choose)) like DIM ARRAY(5).
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
FINALLY! I have a texture pack system with easy-install working with no problems! ! I will try to post the QRs today, along with instructions on installing/making textures.
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
Here's a tiny update: I have the design for the advanced smash bros engine down now. The one that will incorperate the new features of the update.
if you want an idea of how the engines going to be built check my template typed array code.
Characters will be stored as typed arrays.
The system will be more complex though and feature a much larger codebase. Probably a couple thousand lines of code for the entire engine plus menus plus etc. I will not have much left.. after this to work with.
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 tiny update: I have the design for the advanced smash bros engine down now. The one that will incorperate the new features of the update.
if you want an idea of how the engines going to be built check my template typed array code.
Characters will be stored as typed arrays.
The system will be more complex though and feature a much larger codebase. Probably a couple thousand lines of code for the entire engine plus menus plus etc. I will not have much left.. after this to work with.
So. Many. Constant. Updates. D:<
(lol)
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
This specific code has not been tested yet, as I always use double dimention arrays with DATA, so let me know if there are any problems.
It's not possible. What that will do is to put values 1-8 into Array[9-16].
Why don't you just use a string and MID$ into it? That's how I usually do it, anyway.
Regarding your other post: Why don't you try it and see? I don't think putting variables into DATA statement will work, though. I'd just as soon keep a separate array.
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
Raycraft is awesome but my l and r buttons are broken. I was trying to make it so you could turn with y and b but when ever I walked forward it turned to the left. I was wondering how I could succsesfully do what I'm tryingto do edit: nm I fixed it
Raycraft is awesome but my l and r buttons are broken. I was trying to make it so you could turn with y and b but when ever I walked forward it turned to the left. I was wondering how I could succsesfully do what I'm tryingto do edit: nm I fixed it
Glad you like it!
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
I was wondering if you guys could help me clear up my mess of code. Like, maybe there's other ways to do what I was trying to do? Thanks, ask any questions if you have 'em.
Code:
ACLS:BGMSTOP
LOCATE 9,11 : COLOR 15
PRINT "┌──────────────┐"
PRINT " │START TO PLAY!│"
PRINT " └──────────────┘"
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
I was wondering if you guys could help me clear up my mess of code. Like, maybe there's other ways to do what I was trying to do? Thanks, ask any questions if you have 'em.
You probably want to just post the QR code for something this long. The init could be group together. I'd create the bullet sprite in the init as well. That way, you can skip the WAIT command in @SHOOT without any trouble. @SHOOT can be one function, with different parameters. Learn ARRAY variables and use that for direction. Skip the WAIT command in starting screen and @SHOOT function.
Looks great so far! Please continue developing the game. Once you have the logic down pat, start adding sound effects.
You probably want to just post the QR code for something this long. The init could be group together. I'd create the bullet sprite in the init as well. That way, you can skip the WAIT command in @SHOOT without any trouble. @SHOOT can be one function, with different parameters. Learn ARRAY variables and use that for direction. Skip the WAIT command in starting screen and @SHOOT function.
Looks great so far! Please continue developing the game. Once you have the logic down pat, start adding sound effects.
I love you community on here ! Hmm, I see what you mean, thanks. Does anyone know of any simple array tutorials? Because I haven't dealt with them before, and I'm eager to learn .
@IAmAPerson620 Amazing........ but my R key has issues. It works only after I blow on it like 50 times. And only temporarily. Good game though
@noxuss Oh GOD (just playing with ya XD). There are things that concern me though. 1: Don't use GOTO for the directions, try GOSUB. Maybe that would be nicer. Also, try BUTTON() instead of BTRIG. I have the feeling that when you press the directional button, the sprite or whatever stops at a coordinate, and you have to press the button again. Am I right??
I don't have a 3DS so what do I put here? -Damolii
@IAmAPerson620 Amazing........ but my R key has issues. It works only after I blow on it like 50 times. And only temporarily. Good game though
@noxuss Oh GOD (just playing with ya XD). There are things that concern me though. 1: Don't use GOTO for the directions, try GOSUB. Maybe that would be nicer. Also, try BUTTON() instead of BTRIG. I have the feeling that when you press the directional button, the sprite or whatever stops at a coordinate, and you have to press the button again. Am I right??
I tried using GOSUB but I couldn't get it working, it was as if it was treating GOSUB as GOTO. yesss, you're right about that button thing
Forums
Topic: Petit Computer
Posts 3,921 to 3,940 of 9,620
Please login or sign up to reply to this topic