People learning differently

Ok I know some people have seen me around the Forums asking a lot of questions if you know what I mean :). So I recently became a developer at age 14 now 15 last year in the end of May. At about 6 months of being a developer, and using Corona SDK. I had already have 5 games but using GameSalad not so successful. Then I found Corona SDK and and got excited how EASY! it was. At that very moment I knew this is were my company will take take off. After my first release app using Corona my first app http://itunes.apple.com/us/app/iminecraft-guide/id483665037?ls=1&mt=8 (iMinecraft Guide) became a huge success. After releasing several games made using Corona SDK
http://itunes.apple.com/us/app/minecraft-quiz/id504217017?ls=1&mt=8
http://itunes.apple.com/us/app/enix/id498396092?ls=1&mt=8
http://itunes.apple.com/us/app/minigames/id459966736?ls=1&mt=8
http://itunes.apple.com/us/app/deceased-city/id514481898?ls=1&mt=8

I was able to release these games because of the help of the Community, but if I had never got this service my company would of not token off. I started with no knowledge of coding into I consider myself a newbie.

But I have been thinking I struggle myself to learn a simple language like Lua. I can still manage to build a games but not so complex. I’m better off if a person teaches me coding than me learning it myself because when I get stuck I need help to ask questions.

So I want to know from you guys if you some of you face the same problem learning or you grasp this easily.

Would you guys think I will still be a successful developer even though the best way for me to learn is if someone taught me?

P.S Sorry for my bad grammar
[import]uid: 17058 topic_id: 25651 reply_id: 325651[/import]

Getting help from people is no problem, but if for every other new feature you need help I would say you need to try harder.

Personally after my first two weeks of programming and when I started learning the code, everything just came to me. I have been able to replicate any type of game system I’ve wanted so far. What I would suggest is for you to study on math in school. I was always really good at math and think that is one reason why I managed to do a lot of the things I’ve done. Lua is my first programming language btw

If you ever need some code samples feel free to ask, I’m usually up for trying new game mechanics for fun.

hatethinkingofnamez@yahoo.com [import]uid: 77199 topic_id: 25651 reply_id: 103640[/import]

@hatethinkingofnames I’m good at math also the is my favorite subject really. I don’t know why I can’t learn it Lua easily. But you know people learn differently.

I appreciate your offering to help :). Thanks [import]uid: 17058 topic_id: 25651 reply_id: 103641[/import]

Maybe we should both think of a game mechanic we havent done, something simple, and both do it. Then exchange and see how we each did it and how we thought about doing it. Im curious how you code in Lua now [import]uid: 77199 topic_id: 25651 reply_id: 103642[/import]

So what do you want me to exchange?

What examples do you want to see? That is if I got examples that you want to see [import]uid: 17058 topic_id: 25651 reply_id: 103643[/import]

Well if you was to see my coding I would be coding in basic like using functions, ego, booleans, etc… In most of my games I never put tables because my knowledge in table is weak, and also hard to integrate in my game. [import]uid: 17058 topic_id: 25651 reply_id: 103645[/import]

We can make a simple snake or mario game. Or something else you have in mind, using only the bare minimum coding required. We wouldnt do the entire game of course, just the basic gameplay of each one [import]uid: 77199 topic_id: 25651 reply_id: 103647[/import]

So what are you trying to say is I does not take complex coding to make complex games like Mario , or snake which is not that complex [import]uid: 17058 topic_id: 25651 reply_id: 103648[/import]

No, no. I said simple code only so we don’t waste too much time creating a test game. I am only curious in the way you code. That’s why if you’d want we can both create the same thing so you don’t do it alone, I get to see yours to see how you made it and then you can see how I made it as well if you’d like. [import]uid: 77199 topic_id: 25651 reply_id: 103649[/import]

sebitttas goodpoint, i know it can be hard when you get stuck trying to code something. I’m currently stuck with creating a inventory system with storyboard. I’m unable to find code or samples to help me out.

I went out to pay for corona pro as the new daily build supports storyboard.stage. i was hoping to get it working but i have no clue on how to store objects in it.

any one can help me ???

maybe hatethinkingofnames would you have time to create a simple template for a inventory system that works with storyboard [import]uid: 17701 topic_id: 25651 reply_id: 103650[/import]

@hatethinkingofnames so what example do you want me to try to do ?

and

@emanouel it does get when your stuck but if you get help like me and ask in the forum you might seek your answer [import]uid: 17058 topic_id: 25651 reply_id: 103653[/import]

my current code is below

main.lua

display.setStatusBar( display.HiddenStatusBar )  
local storyboard = require "storyboard"  
   
-- background should appear behind all scenes  
-- local background = display.newImage( "assets/graphics/bg.png" )  
   
-- tab bar image should appear above all scenes  
local tabBar = display.newImage( "assets/graphics/tabbar.png" )  
tabBar:setReferencePoint( display.BottomLeftReferencePoint )  
tabBar.x, tabBar.y = 0, display.contentHeight  
   
-- put everything in the right order  
local display\_stage = display.getCurrentStage()  
-- display\_stage:insert( background )  
display\_stage:insert( storyboard.stage )  
display\_stage:insert( tabBar )  
   
-- go to the first scene  
storyboard.gotoScene( "scene1", "fade", 300 )  

and

scene1.lua

[code]

– Room 1

local storyboard = require( “storyboard” )
local scene = storyboard.newScene()
local lastScene = storyboard.getPrevious()

– BEGINNING OF YOUR IMPLEMENTATION

local background, room2, blackKey, blackdoorlocked, text1

– Touch event listener for background image
local function gotoRoom2( self, event )
if event.phase == “began” then

storyboard.gotoScene( “scene2”, “fade”, 400 )

return true
end
end

local function doorlocked( self, event )
if event.phase == “began” then
– storyboard.gotoScene( “scene20”, “fade”, 400 )
text1 = display.newText( “Door is Locked, the key should be near by”, 0, 245, native.systemFontBold, 20 )
text1:setTextColor( 255 )
transition.to(text1, {time=1000, onComplete = function() display.remove(text1) end})
return true

elseif(event.phase == “moved”) then
– Do Something During the “moved” phase
transition.to(self, {x = event.x, y = event.y, time=0});
end
end

local function onSceneTouchx( self, event )
if event.phase == “began” then

storyboard.gotoScene( “scene3”, “fade”, 400 )

return true
end
end

– Called when the scene’s view does not exist:
function scene:createScene( event )
local screenGroup = self.view

background = display.newImage( “assets/graphics/Room1.png”, 0, 0 )
screenGroup:insert( background )

blackdoorlocked = display.newImage( “assets/graphics/BlackLock2.png”, 175, 0 )
screenGroup:insert( blackdoorlocked )

blackdoorlocked.touch = doorlocked

room2 = display.newImage( “assets/graphics/gotoRoom2.png”, 175, 0 )
screenGroup:insert( room2 )

room2.touch = gotoRoom2

blackKey = display.newImage( “assets/graphics/BlackKey.png”, 100, 200 )
screenGroup:insert( blackKey )

blackKey.touch = onSceneTouchx

print( “\n1: createScene event”)
end
– Called immediately after scene has moved onscreen:
function scene:enterScene( event )

print( “1: enterScene event” )

– remove previous scene’s view
storyboard.purgeScene( lastScene )
print( “last scene was:”, lastScene ) – output: last scene name

– Update Lua memory text display
blackKey:addEventListener( “touch”, blackKey )
room2:addEventListener( “touch”, room2 )
blackdoorlocked:addEventListener( “touch”, blackdoorlocked )

end
– Called when scene is about to move offscreen:
function scene:exitScene( event )

print( “1: exitScene event” )

– remove touch listener for image
blackKey:removeEventListener( “touch”, blackKey )
room2:removeEventListener( “touch”, room2 )
blackdoorlocked:removeEventListener( “touch”, blackdoorlocked )
end
– Called prior to the removal of scene’s “view” (display group)
function scene:destroyScene( event )

print( “((destroying scene 1’s view))” )
end


– END OF YOUR IMPLEMENTATION

– “createScene” event is dispatched if scene’s view does not exist
scene:addEventListener( “createScene”, scene )

– “enterScene” event is dispatched whenever scene transition has finished
scene:addEventListener( “enterScene”, scene )

– “exitScene” event is dispatched before next scene’s transition begins
scene:addEventListener( “exitScene”, scene )

– “destroyScene” event is dispatched before view is unloaded, which can be
– automatically unloaded in low memory situations, or explicitly via a call to
– storyboard.purgeScene() or storyboard.removeScene().
scene:addEventListener( “destroyScene”, scene )


return scene
[/code] [import]uid: 17701 topic_id: 25651 reply_id: 103654[/import]

sebitttas,

i did ask for help, no one has posted a respond regarding the issue.

maybe tomorrow:)

[import]uid: 17701 topic_id: 25651 reply_id: 103655[/import]

@emanouel yeah and I also get the same problem too. It took me like days to figure particular things. Sorry for not being much help but if you just find someone knowledgeable to help then good. Just try hard to get help [import]uid: 17058 topic_id: 25651 reply_id: 103656[/import]

thanks for the advice, ill try looking around for more code and see what i can come up with.

maybe something in director class might work as well.

its already late, I’m off to sleep. going to try again tomorrow:)

thanks for your advice [import]uid: 17701 topic_id: 25651 reply_id: 103657[/import]

@sebittas not sure, is there any game mechanic you would like to try and do yourself?

@emanouel I haven’t switched to storyboard yet, I still use director. thinking about WoW type inventory I can think of quite a bit of code involved for that. ive never tried making an inventory but heres something quick i put up for you to look at, not sure how you want your inventory

[code]
i = 1
spaceX = 50
spaceY = 250
local space = {}

local function inventory()
for n = 1, 10 do
spaceX = spaceX + 25
space[i] = display.newRect( spaceX, spaceY, 25, 25 )
space[i].strokeWidth = 2
space[i]:setFillColor( 80, 80, 80 )
space[i]:setStrokeColor( 50, 50, 50 )
space[i].myName = “space”
i = i + 1
end
spaceY = spaceY + 25
spaceX = 50
end
inventory()
inventory()

local key = display.newCircle( 150, 150, 10 )
key:setFillColor( 255, 0, 0 )

local ring = display.newCircle( 250, 150, 10 )
ring:setFillColor( 0, 255, 0 )

local test

local function moveStuff( event )
if event.phase == “began” then
test = event.target
end
if event.phase == “moved” then
test.x = event.x
test.y = event.y
end
if event.phase == “ended” then
if test.y > 250 and test.y < 275 then
test.y = 262.5
elseif test.y > 275 and test.y < 300 then
test.y = 287.5
end
if test.y > 250 and test.y < 300 then
if test.x > 75 and test.x < 100 then
test.x = 87.5
elseif test.x > 100 and test.x < 125 then
test.x = 112.5
elseif test.x > 125 and test.x < 150 then
test.x = 137.5
elseif test.x > 150 and test.x < 175 then
test.x = 162.5
elseif test.x > 175 and test.x < 200 then
test.x = 187.5
elseif test.x > 200 and test.x < 225 then
test.x = 212.5
elseif test.x > 225 and test.x < 250 then
test.x = 237.5
elseif test.x > 250 and test.x < 275 then
test.x = 262.5
elseif test.x > 275 and test.x < 300 then
test.x = 287.5
elseif test.x > 300 and test.x < 325 then
test.x = 312.5
end
end

end

end
ring:addEventListener( “touch”, moveStuff )
key:addEventListener( “touch”, moveStuff )
[/code] [import]uid: 77199 topic_id: 25651 reply_id: 103716[/import]

hatethinkingofnames,

thanks so much for the code , I’m going to give it a try. i guess i place it into the main.lua file

ill reply shortly
[import]uid: 17701 topic_id: 25651 reply_id: 103743[/import]

hatethinkingofnames,

thanks again, the code ran without errors. but i would need it to

  1. when key is clicked it would be placed into a free spot in the inventory bar.
  2. the objects would be created in scene1.lua not in the main.lua, as each room (scene) would have different objects placed within them. the problem is that i need a way for objects to get stored into the inventory built from main.lua.

im assuming thats the best way to program that. i guess each scene file must be able to write and read from the updated main.lua file.

i know this would be more complex.

the inventory would be around 55x480 (basically fills the bottom of the screen,
[] [] [] [] [] [] [] [] []

thanks again for the sample code you placed
simple layout of game

_____________________________Scene3_____________________________
_____________________________ +
Scene1 ->DOOR LOCKED => Scene 2 -> Scene 5
_____________________________+
_____________________________Scene 7_____________________________

Game Logic

  • Start the Game
  • Enter Scene 1
  • Pick up BlackKey and store it in inventory
  • select BlackKey From inventory and UnLock Door
  • Black Key is removed from inventory
  • Open the door to enter into Scene 2
    [import]uid: 17701 topic_id: 25651 reply_id: 103749[/import]

Hey emanouel, sorry to say but I’m going on a trip Monday and I’ll be gone for 3 weeks so I don’t really have time to do the whole main.lua scene1.lua etc, especially since I’d have to read up on storyboard and I should be packing right about now lol. I did make a quick demo for you on your thing, what you gotta do is just save some of the variable’s so that they load in your other scenes depending on what you want exactly. Anyway good luck!

[code]
i = 1
spaceX = -101
spaceY = 263
gotKey = false
local space = {}

local function inventory()
for n = 1, 10 do
spaceX = spaceX + 57
space[i] = display.newRect( spaceX, spaceY, 57, 55 )
space[i].strokeWidth = 2
space[i]:setFillColor( 80, 80, 80 )
space[i]:setStrokeColor( 50, 50, 50 )
space[i].myName = “space”
i = i + 1
end
end
inventory()
local key = display.newCircle( 150, 150, 25 )
key:setFillColor( 255, 0, 0 )

local test
slotNum = 1

local function obtainKey( event )
if event.phase == “began” then
test = event.target
gotKey = true
if slotNum == 1 then
test.x = -16
test.y = 291
slotNum = slotNum + 1
elseif slotNum == 2 then
test.x = 42
test.y = 291
slotNum = slotNum + 1
elseif slotNum == 3 then
test.x = 98
test.y = 291
slotNum = slotNum + 1
elseif slotNum == 4 then
test.x = 156
test.y = 291
slotNum = slotNum + 1
elseif slotNum == 5 then
test.x = 212
test.y = 291
slotNum = slotNum + 1
elseif slotNum == 6 then
test.x = 270
test.y = 291
slotNum = slotNum + 1
elseif slotNum == 7 then
test.x = 327
test.y = 291
slotNum = slotNum + 1
elseif slotNum == 8 then
test.x = 384
test.y = 291
slotNum = slotNum + 1
elseif slotNum == 9 then
test.x = 441
test.y = 291
slotNum = slotNum + 1
elseif slotNum == 10 then
test.x = 498
test.y = 291
slotNum = 1
end
end
end
key:addEventListener( “touch”, obtainKey )

local myText = display.newText("", 70, 30, native.systemFont, 16)
local door = display.newRect( 50, 50, 60, 100 )

local function openDoor()
if gotKey == true then
key:removeSelf()
key = nil
myText.text = “Door is now open!”
end
if gotKey == false then
myText.text = “Go look for the key”
end
end
door:addEventListener( “touch”, openDoor )

[/code] [import]uid: 77199 topic_id: 25651 reply_id: 103753[/import]

hatethinkingofnames,

wow thanks so much for the coding. i really appreciate it. hope you have a good 3 week vocation. were are you heading ?

ill look into the code and see how i can save the items in other scenes as well.

the demo looks good, I’m going to be playing around with it and see what i can come up with.

its a very good starting point.

ill update you when you get back from the trip.

[import]uid: 17701 topic_id: 25651 reply_id: 103784[/import]